From 62c8aa6fa10339400b97cafd86a756bed917102e Mon Sep 17 00:00:00 2001 From: zhou-yg Date: Tue, 28 May 2019 21:12:53 +0800 Subject: [PATCH] [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. --- src/index.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/index.js b/src/index.js index 0024625..47b2691 100644 --- a/src/index.js +++ b/src/index.js @@ -20,7 +20,6 @@ const init = ({ app, server, options }) => { realm, config: { ...config, - path: app.mountpath } }); @@ -89,8 +88,6 @@ function PeerServer (options = {}, callback) { let path = options.path; const port = options.port; - delete options.path; - if (path[0] !== '/') { path = '/' + path; } @@ -109,7 +106,7 @@ function PeerServer (options = {}, callback) { } const peerjs = ExpressPeerServer(server, options); - app.use(path, peerjs); + app.use(peerjs); if (callback) { server.listen(port, () => {