Unable to do Websocket Connection
Anonymous
TRIALOP

a year ago

Hi, im trying to do a simple app using websocket and trying to test it with an online client tester https://piehost.com/websocket-tester, below are my code:

```const PORT = process.env.PORT || 3003;
const PUBLICDOMAIN = process.env.RAILWAYPUBLIC_DOMAIN;
const httpsServer = https.createServer(app);

const webSocketServer = new WebSocket.Server({ port: PORT })

httpsServer.listen(() =>
{
console.log(Server running on port ${PORT});
console.log(WebSocket URL: wss://${PUBLIC_DOMAIN});
});```

When i tried to connect to the url wss://.....[railway.app](railway.app) as pasted below it simply said i failed.
Many thanks! Im on the Free Trial plan also.

Solved

5 Replies

Anonymous
TRIALOP

a year ago

ef7188c6-6be1-4f21-8b57-88b5e55eeef4


a year ago

hello,

please see our docs on this topic -


Anonymous
TRIALOP

a year ago

thanks it worked!


a year ago

awsome!


a year ago

!s


Status changed to Solved brody about 1 year ago


Loading...