修改wss
This commit is contained in:
parent
7e1db4bd92
commit
8ec1f6096a
|
|
@ -2,7 +2,10 @@ APP_NAME=Laravel
|
|||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
APP_URL=http://testcall.shupian.cn
|
||||
FS_HOST=192.168.254.216
|
||||
FS_WSS_URL=testcall.shupian.cn
|
||||
WEBSOCKET_URL=testcall.shupian.cn
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class IndexController extends Controller
|
|||
'host' => config('freeswitch.host'),
|
||||
'uri' => $user->sip->username . '@' . config('freeswitch.host'),
|
||||
'wss_url' => config('freeswitch.wss_url'),
|
||||
'websocket_url' => config('freeswitch.websocket_url'),
|
||||
];
|
||||
return View::make("layout", compact('data'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,8 +44,9 @@ return [
|
|||
'api' => 'api_exec_queue',
|
||||
],
|
||||
'record_url' => env('APP_URL','http://localhost'),
|
||||
'host' => '192.168.254.216',
|
||||
'wss_url' => 'testcall.shupian.cn',
|
||||
'host' => env('FS_HOST','127.0.0.1'),
|
||||
'wss_url' => env('FS_WSS_URL','127.0.0.1'),
|
||||
'websocket_url' => env('WEBSOCKET_URL','127.0.0.1'),
|
||||
|
||||
'node_type' => [
|
||||
1 => '公共节点',
|
||||
|
|
|
|||
|
|
@ -0,0 +1,15 @@
|
|||
location / {
|
||||
try_files $uri $uri/ /index.php$is_args$query_string;
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Credentials' 'true';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
|
||||
}
|
||||
location /wss {
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "Upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_pass http://127.0.0.1:9502;#代理到上面的地址去
|
||||
}
|
||||
|
|
@ -330,7 +330,6 @@
|
|||
userAgent.start()
|
||||
}
|
||||
|
||||
|
||||
$("#regBtn").click(function () {
|
||||
initUserAgent();
|
||||
userAgent.register();
|
||||
|
|
@ -340,9 +339,9 @@
|
|||
userAgent.unregister()
|
||||
}
|
||||
})
|
||||
@endif
|
||||
|
||||
|
||||
const ws = new WebSocket("ws://127.0.0.1:9502?user_id={{auth()->user()->id}}")
|
||||
const ws = new WebSocket("wss://{{$data['websocket_url']}}/wss?user_id={{auth()->user()->id}}")
|
||||
var ticker
|
||||
ws.onopen = function () {
|
||||
ticker = setInterval(function () {
|
||||
|
|
@ -371,7 +370,7 @@
|
|||
clearInterval(ticker)
|
||||
}
|
||||
}
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue