-
Notifications
You must be signed in to change notification settings - Fork 6
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
Example for establishing a full connection of ohttp #38
Comments
Hey @YKunDong thanks for your interest in OHTTP 🦸♂️ I agree, the resources on how to actually use OHTTP in practice are limited, and cloudflare's ohttp relay is the only implementation one I know of besides the ohttp-relay we maintain in this organization. Please find a full example of an OHTTP client using this library to transmit its message over an ohttp relay to an ohttp gateway and finally target in this e2e test. There's a lot of other application code in there, but between e2e and this integration test suite you should be able to find what you're looking for. I do think an actual dead-simple example is needed in the ohttp-relay crate. That would require someone write up the gateway and target servers inside an example, and call ohttp_relay to listen as a proxy in between. Let me know if you find what you're looking for in these tests. |
Thanks for the material provided. Having the relay running, which listens on tcp://0.0.0.0:3000 in my test. I set the proxy as following, and the connection between client - relay - gateway is successfully established. HTTPS_PROXY=http://127.0.0.1:3000 |
Hey bro @YKunDong Did you still use the client and server from https://github.com/martinthomson/ohttp in your test? I found that the server cannot identify the CONNECT request from the relay. So how do you address it? Thank you for your assistance and support! |
Hi, I do use that project. But I don’t quite understand your question. Could you provide more detail? |
Now it seems to be working perfectly again, and I'm not sure what caused that error initially. Previously, after the client sent 'CONNECT localhost:9443 HTTP/1.1' to the relay, the relay responded with 'HTTP/1.1 400 Bad Request'. |
I am trying to implement the ohttp recently. Although there are project of relay, and project for client and server (https://github.com/martinthomson/ohttp), I find it difficult to make them work together.
Is it possible to show an example to establish a full connection of ohtttp, like, combining these two project?
Any suggestion or help will be appreciated.
The text was updated successfully, but these errors were encountered: