Using with socket.io and express
See original GitHub issueI’m having an issue:
-
Give an expressive description of what is went wrong Starting an ExpressPeerServer in a server that runs express and socket.io breaks socket.io. Apparently both use the same port and this wrecks havoc, but this used to work with previous versions.
-
Version of
peeryou’re experiencing this issue 0.5.3 -
Nodejs version? v10
-
Platform name and its version (Win, Mac, Linux)? Linux. Also, socket.io 2.3.0.
-
Nice to have: a repository with code to reproduce the issue Sorry, don’t have
-
If you’re getting an error or exception, please provide its full stack-trace as plain-text or screenshot There’s no error. socket.io starts, but
app.use('/peerjs', peerserverSSL);breaks socket.io connections.
This used to work with "peerjs-server": "^0.2.9", but broke after updating to current.
Is this a bug or is peerjs now incompatible with socket.io? If incompatible, any suggestions for a workaround? Create a new peerjs server without using express perhaps? Thanks
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:7 (3 by maintainers)

Top Related StackOverflow Question
so if anyone runs into this: no, you cannot run with express and socket.io at the same time. peerjs now seems to use the same websocket attachment to express than socketio. run a separate peerserver.
@dummy26 Create it directly like https://github.com/peers/peerjs-server#create-a-custom-server