mirror of
https://github.com/tl-open-source/tl-rtc-file.git
synced 2025-09-26 19:41:16 +08:00
feat: change socket env key
This commit is contained in:
@@ -67,7 +67,7 @@ npm install
|
||||
|
||||
## websocket服务地址
|
||||
## "ws://域名 或者 ws://ip:端口 或者 ws://域名:端口"
|
||||
tl_rtc_file_ws_host=ws://127.0.0.1:8444
|
||||
tl_rtc_file_socket_host=ws://127.0.0.1:8444
|
||||
|
||||
|
||||
## 启动 (必须步骤)
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#########################
|
||||
# 一键推送dockerhub的脚本
|
||||
# @auther: iamtsm
|
||||
# @version: v1.1.0
|
||||
# @version: v1.2.0
|
||||
#########################
|
||||
|
||||
build_and_push_image() {
|
||||
|
@@ -101,7 +101,7 @@ docker run \
|
||||
-e "tl_rtc_file_env_mode=http" \
|
||||
-e tl_rtc_file_api_port \
|
||||
-e tl_rtc_file_ws_port \
|
||||
-e tl_rtc_file_ws_host \
|
||||
-e tl_rtc_file_socket_host \
|
||||
-e tl_rtc_file_webrtc_stun_host \
|
||||
-e tl_rtc_file_webrtc_turn_host \
|
||||
-e tl_rtc_file_webrtc_turn_username \
|
||||
@@ -143,7 +143,7 @@ docker run \
|
||||
-e "tl_rtc_file_env_mode=http" \
|
||||
-e tl_rtc_file_api_port \
|
||||
-e tl_rtc_file_ws_port \
|
||||
-e tl_rtc_file_ws_host \
|
||||
-e tl_rtc_file_socket_host \
|
||||
-e tl_rtc_file_webrtc_stun_host \
|
||||
-e tl_rtc_file_webrtc_turn_host \
|
||||
-e tl_rtc_file_webrtc_turn_username \
|
||||
|
@@ -72,7 +72,7 @@ tl_rtc_file_ws_port=8444
|
||||
## Websocket server address
|
||||
## "ws://domain or ip:port or domain:port"
|
||||
## For socket ip, use LAN IP for LAN access and public IP for public access
|
||||
tl_rtc_file_ws_host=ws://127.0.0.1:8444
|
||||
tl_rtc_file_socket_host=ws://127.0.0.1:8444
|
||||
```
|
||||
|
||||
## Startup (Mandatory Steps)
|
||||
|
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"version": "10.3.6",
|
||||
"ws": {
|
||||
"socket": {
|
||||
"port": "请到 tlrtcfile.env 中进行配置",
|
||||
"host": "请到 tlrtcfile.env 中进行配置"
|
||||
},
|
||||
|
@@ -30,7 +30,7 @@ function initData(req, res) {
|
||||
|
||||
let data = {
|
||||
version : conf.version,
|
||||
wsHost: conf.ws.host || ip,
|
||||
wsHost: conf.socket.host || ip,
|
||||
rtcConfig: { iceServers },
|
||||
options: webrtcConf.options,
|
||||
logo : utils.genClientLogo(),
|
||||
@@ -41,7 +41,7 @@ function initData(req, res) {
|
||||
|
||||
let data = {
|
||||
version : conf.version,
|
||||
wsHost: conf.ws.host,
|
||||
wsHost: conf.socket.host,
|
||||
rtcConfig: { iceServers },
|
||||
options: webrtcConf.options,
|
||||
logo : utils.genClientLogo(),
|
||||
|
@@ -19,14 +19,14 @@ async function start(){
|
||||
let io = null;
|
||||
|
||||
if(process.env.tl_rtc_file_env_mode == 'http'){
|
||||
io = socketIO.listen(http.createServer().listen(conf.ws.port));
|
||||
io = socketIO.listen(http.createServer().listen(conf.socket.port));
|
||||
}else{
|
||||
let options = {
|
||||
key: fs.readFileSync('./conf/keys/server.key'),
|
||||
cert: fs.readFileSync('./conf/keys/server.crt')
|
||||
}
|
||||
io = socketIO.listen(
|
||||
https.createServer(options).listen(conf.ws.port)
|
||||
https.createServer(options).listen(conf.socket.port)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ async function start(){
|
||||
}
|
||||
|
||||
utils.tlConsole("socket init done ...")
|
||||
utils.tlConsole("socket ",process.env.tl_rtc_file_env_mode," server listen on ", conf.ws.port, " successful");
|
||||
utils.tlConsole("socket ",process.env.tl_rtc_file_env_mode," server listen on ", conf.socket.port, " successful");
|
||||
}
|
||||
|
||||
|
||||
|
@@ -4,7 +4,7 @@ tl_rtc_file_api_port=9092
|
||||
## websocket服务端口
|
||||
tl_rtc_file_ws_port=8444
|
||||
## websocket服务地址
|
||||
tl_rtc_file_ws_host=ws://127.0.0.1:8444
|
||||
tl_rtc_file_socket_host=ws://127.0.0.1:8444
|
||||
|
||||
|
||||
#-----------------以下为webrtc相关配置-----------------#
|
||||
|
Reference in New Issue
Block a user