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

Iroh fails when running through an outbound HTTPS proxy #2295

Closed
b5 opened this issue May 15, 2024 · 2 comments · Fixed by #2298
Closed

Iroh fails when running through an outbound HTTPS proxy #2295

b5 opened this issue May 15, 2024 · 2 comments · Fixed by #2298
Assignees
Labels
c-iroh-net feat New feature or request
Milestone

Comments

@b5
Copy link
Member

b5 commented May 15, 2024

  • this user is running a proxy that forces outbound HTTP traffic onto a port that isn't 443
  • router blocks outbound traffic on 443, it should follow redirects, apparently in the way recent versions of reqwest do
  • log: https://gist.github.com/zicklag/d6e2fb694650cabcb556258f30dd7405
  • from the user: "it looks like it fails with a couple timeouts, which is usually what happens when something tries to go outbound on 443 and the router blocks it."
@zicklag
Copy link

zicklag commented May 15, 2024

Further background, the most common way to configure the http(s) proxy is through environment variables: http_proxy, https_proxy, no_proxy, or their uppercase variants.


This appears to be the function in question. Since you're using hyper directly, instead of reqwest or ureq or some other http client library that already supports proxies, it might mean a bit more work for us. I think maybe the best route would be to try and lift the proxy logic from reqwest if possible. I'm pretty sure it also uses hyper.

@dignifiedquire
Copy link
Contributor

https://github.com/siketyan/hyper-proxy2 looks like it should be easy to use

@dignifiedquire dignifiedquire added feat New feature or request c-iroh-net labels May 15, 2024
@dignifiedquire dignifiedquire self-assigned this May 16, 2024
@dignifiedquire dignifiedquire added this to the v0.17.0 milestone May 16, 2024
github-merge-queue bot pushed a commit that referenced this issue May 22, 2024
Headers are based on how `curl` and env variables on`reqwest`.

Setting any of 

- `HTTP_PROXY`
- `http_proxy`
- `HTTPS_PROXY`
- `https_proxy`

will make all relay code use these to proxy outgoing connections.

Closes #2295 

## Breaking Changes

- Added `iroh_net::endpoint::Builder::proxy_url`
- Added `iroh_net::endpoint::Builder::proxy_from_env`
- Added `iroh_net::relay::http::ClientError::Proxy` enum variant

## TODOs

- [x] config & parsing env variables
- [x] the todos in the code
- [x] https proxy 
- [x] testing: tested manually on two machines using `squid`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-iroh-net feat New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants