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

Update to support ws library #16

Closed
wants to merge 1 commit into from
Closed

Update to support ws library #16

wants to merge 1 commit into from

Conversation

davidje13
Copy link
Owner

Hi @artem7902 - I saw you forked the repository to make it compatible with WebSocketServer servers. I think that's a reasonable thing for the core project to be compatible with, so I've made this PR to discuss your changes.

Your changes make the library mostly compatible, but it's still possible for somebody to make a https WebSocketServer, and because of this line, that won't be detected correctly (the library will communicate as http).

I wonder if instead it might be possible to access the underlying raw server here, though I see that there is no official API for this in ws (it could be done with server._server but that's not very future-proof). I raised a request on the ws project: websockets/ws#2068 — let's see what they think.

Finally, it would of course be nice to get some basic testing for this compatibility, but I can pick that up if you're not interested.

@davidje13
Copy link
Owner Author

I've added support for this in 2.0.3, but I also took the opportunity to refactor the method a bit and add tests for https servers (including wrapped inside WebSocketServer) 3675d75

@davidje13 davidje13 closed this Jul 20, 2022
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

Successfully merging this pull request may close these issues.

None yet

2 participants