Get Meteor Websocket URL

Please tell me How to Get WS URL of a Meteor Application?

It’s basically the same as the URL. Once the connection has been upgraded, the underlying protocol part changes, so:

https://app123.blah.com becomes wss://app123.blah.com

So as long as the ports haven’t been changed from the default (which in production will normally be the HTTP standard 80 or 443) you should be good to go. If the port is different you’ll just append that in the usual way:

http://app321.blah.com:8080 becomes ws://app321.blah.com:8080

i am trying in this way –
DDP.connect("ws://http://localhost:3000/")

getting this error > XMLHttpRequest cannot load ws://http//localhost:3000/sockjs/info?cb=vxa6srp8lo. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.

any idea ?

If you use DDP.connect, you shouldn’t need to figure out what exact WS url is. You just need your app url, where you can visit this app.

2 Likes