Can't get mediasoup demo v3 running on Ubuntu Desktop 20.04: WebSocket connection failed

Hi, I can’t get mediasoup demo v3 running on my laptop that has Ubuntu Desktop 20.04, have all requirements installed (https://mediasoup.org/documentation/v3/mediasoup/installation/#requirements).
After running server and app, the browser cannot connect to the websocket server and outputs this:

WebSocket connection failed

I’m not sure if this is related to a error I am having in the server terminal.

This is what the terminal running server outputs:

...

  mediasoup-demo-server:INFO running 2 mediasoup Workers... +0ms
  mediasoup createWorker() +0ms
  mediasoup:Worker constructor() +0ms
  mediasoup:Worker spawning worker process: /home/server/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/mediasoup-worker --logLevel=warn --logTag=info --logTag=ice --logTag=dtls --logTag=rtp --logTag=srtp --logTag=rtcp --logTag=rtx --logTag=bwe --logTag=score --logTag=simulcast --logTag=svc --logTag=sctp --rtcMinPort=40000 --rtcMaxPort=49999 +0ms
  mediasoup:Channel constructor() +0ms
  mediasoup:PayloadChannel constructor() +0ms
  mediasoup:Worker close() +4ms
  mediasoup:Channel close() +1ms
  mediasoup:PayloadChannel close() +1ms
  mediasoup:ERROR:Worker worker process failed [pid:undefined]: spawn /home/server/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/mediasoup-worker ENOENT +0ms
(node:34805) UnhandledPromiseRejectionWarning: Error: spawn /home/server/mediasoup-demo/server/node_modules/mediasoup/worker/out/Release/mediasoup-worker ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:34805) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:34805) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

[opening Readline Command Console...]
type help to print available commands
cmd>

And the Google Chrome console:

protoo-client:WebSocketTransport constructor() [url:wss://localhost:4443/?roomId=x8gzcj3j&peerId=y7bhr8j8, options:undefined] +0ms
protoo-client:WebSocketTransport _runWebSocket() [currentAttempt:1] +0ms
protoo-client:Peer constructor() +0ms
WebSocket connection to 'wss://localhost:4443/?roomId=x8gzcj3j&peerId=y7bhr8j8' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED
protoo-client:ERROR:WebSocketTransport WebSocket "error" event +0ms
protoo-client:WARN:WebSocketTransport WebSocket "close" event [wasClean:false, code:1006, reason:""] +0ms
protoo-client:Peer emit "failed" [currentAttempt:1] +1s

Obviously mediasoup did not install/compile. Please look for the very same error (ENOENT) in this forum.

1 Like

Thanks a lot!