[bug] fix connecting problem
1.register router path duplicate in 'init' function(line 16) and 'PeerServer' function (line 109) 2.app.mountpath is undefined. It will make WebSocketServer.constructor lost router path.
This commit is contained in:
parent
948a0b8ff2
commit
62c8aa6fa1
@ -20,7 +20,6 @@ const init = ({ app, server, options }) => {
|
|||||||
realm,
|
realm,
|
||||||
config: {
|
config: {
|
||||||
...config,
|
...config,
|
||||||
path: app.mountpath
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -89,8 +88,6 @@ function PeerServer (options = {}, callback) {
|
|||||||
let path = options.path;
|
let path = options.path;
|
||||||
const port = options.port;
|
const port = options.port;
|
||||||
|
|
||||||
delete options.path;
|
|
||||||
|
|
||||||
if (path[0] !== '/') {
|
if (path[0] !== '/') {
|
||||||
path = '/' + path;
|
path = '/' + path;
|
||||||
}
|
}
|
||||||
@ -109,7 +106,7 @@ function PeerServer (options = {}, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const peerjs = ExpressPeerServer(server, options);
|
const peerjs = ExpressPeerServer(server, options);
|
||||||
app.use(path, peerjs);
|
app.use(peerjs);
|
||||||
|
|
||||||
if (callback) {
|
if (callback) {
|
||||||
server.listen(port, () => {
|
server.listen(port, () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user