dash-extensions icon indicating copy to clipboard operation
dash-extensions copied to clipboard

Hope to configure WebSocket URL based on server URL

Open n-arakawa opened this issue 2 years ago • 0 comments

URL property of Websocket is used in browser. I hope there is a way to set the URL based on server-url.

More specifically, I hope that at least the following are taken into account:

  • location.host
  • location.hostname to have a websocket server in other port
  • location.protocol to distinguish between wss and ws

src/lib/components/WebSocket.react.js

        url = url? url : "ws://" + location.host + location.pathname + "ws";
        this.client = new WebSocket(url, protocols);

n-arakawa avatar Nov 26 '23 23:11 n-arakawa