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

enable websocket upgrades without the html5 client #3932

Closed
totaam opened this issue Jul 22, 2023 · 2 comments
Closed

enable websocket upgrades without the html5 client #3932

totaam opened this issue Jul 22, 2023 · 2 comments
Labels
enhancement New feature or request network server

Comments

@totaam
Copy link
Collaborator

totaam commented Jul 22, 2023

Currently the server will not "upgrade" sockets unless the html5 client is installed (the _html flag):

http_upgrade = socket_options.get(http_protocol, self._html) not in FALSE_OPTIONS

Technically, there is no reason for this:

  • one could host the html5 client somewhere else
  • one could want to use the python client in websocket mode to go through a proxy
    etc

The current workaround is to add http=true (or https=true for ssl) to the socket options, ie:
--bind-tcp=0.0.0.0:10000,http=true

@totaam totaam added enhancement New feature or request server network labels Jul 22, 2023
@totaam
Copy link
Collaborator Author

totaam commented Jul 26, 2023

This is hard because in a lot of cases, we process socket upgrades to SSL without knowing if the socket is going to be:

  • a websocket connection
  • an https client
  • a plain ssl connection

And each one of these can have its own toggle.

But it is needed because we currently assume too much. For example, we publish mdns records based on generic socket type mappings rather than what we end up using for deciding whether to upgrade a socket or not.

totaam added a commit that referenced this issue Jul 26, 2023
@totaam
Copy link
Collaborator Author

totaam commented Jul 26, 2023

Mostly done and seems to work, but this needs more testing and therefore was not added to the new v5.x branch.

totaam added a commit that referenced this issue Jul 26, 2023
@totaam totaam closed this as completed Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request network server
Projects
None yet
Development

No branches or pull requests

1 participant