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

Support HTTP proxies in clients connecting to relays over websockets #2418

Open
matheus23 opened this issue Jun 26, 2024 · 1 comment
Open
Assignees
Labels

Comments

@matheus23
Copy link
Contributor

At the moment, iroh clients that connect to a relay via websockets do so using the tokio_tungstenite_wasm library, which doesn't support providing your own AsyncRead/AsyncWrite, so you're not in control of connection establishment (which makes sense because in the browser you don't have control over that).

We should vendor the WebSocketStream library used in tokio_tungstenite_wasm and add our own enum case for a connection where we do provide our own AsyncRead/AsyncWrite (MaybeTlsStreamReader/Writer specifically) and have control over connection establishment.

This enables:

  • HTTP proxy support when connecting to a relay over websockets
  • Writing tests that excercise relay-over-WSS (with TLS, but faked certificates)

Context: #2387 (comment)

@matheus23
Copy link
Contributor Author

I'd say this is somewhat blocked on migrating away from tokio_tungstenite_wasm (see the linked comment in the issue).

Currently I'm waiting for denoland/fastwebsockets#78 to be merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant