Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hope to configure WebSocket URL based on server URL #298

Open
n-arakawa opened this issue Nov 26, 2023 · 0 comments
Open

Hope to configure WebSocket URL based on server URL #298

n-arakawa opened this issue Nov 26, 2023 · 0 comments

Comments

@n-arakawa
Copy link

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant