Skip to content

net.Conn wrapper for *websocket.Conn #80

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

Closed
nhooyr opened this issue Apr 30, 2019 · 2 comments
Closed

net.Conn wrapper for *websocket.Conn #80

nhooyr opened this issue Apr 30, 2019 · 2 comments

Comments

@nhooyr
Copy link
Contributor

nhooyr commented Apr 30, 2019

At the moment, its impossible to create a proper net.Conn wrapper for *websocket.Conn as you cannot implement a SetDeadline method that interrupts a pending read without bricking the connection.

See golang/go#15224 for why a set deadline method that interrupts the connection is useful

@nhooyr
Copy link
Contributor Author

nhooyr commented Apr 30, 2019

Also see Azure/azure-service-bus-go#93

@nhooyr
Copy link
Contributor Author

nhooyr commented May 30, 2019

This is going to be pretty much impossible as if we have a large write or read, we cannot unblock it without bricking the connection because net/http only gives us a io.ReadWriteCloser for dials.

This idea overall seems rather janky. I can't think of when it's a good idea to actually run an arbitrary protocol over WebSocket's like this. If you want to run a protocol over HTTP, just use HTTP Connect. If you are for some reason limited to a browser, you probably shouldn't be running an arbitrary protocol over WebSocket's and this library won't really help you anyway because you're on the browser.

@nhooyr nhooyr closed this as completed May 30, 2019
@nhooyr nhooyr mentioned this issue Jun 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant