我的网站的websocket网址是什么?

Can anyone tell me how to get the websocket url for site?

My site is https://example.com. I have got websocket installed by my hosting provider. But when creating a new connection via websocket url. What will be the url?

Currently I have tried following:-

socket = new WebSocket('wss://example.com');
socket = new WebSocket('wss://example.com:9000');
socket = new WebSocket('wss://example.com:12345/test');

None of the above works. My main objective is to get websocket working so that continuous ajax calls are not made in chat script I am creating in php. Thank you all!!

Which service is providing your websocket backend? To use websockets you would need to have a listener running. Regardless of which listener you're using it will always run on a certain port, this is the port your script should connect to.

Have a look at this answer for example: https://stackoverflow.com/a/27233865/429719 Or take a look at the documentation for these libraries: http://socketo.me/ and http://elephant.io/.