FeraeLabs / skunk

A person-in-the-middle proxy
MIT License
0 stars 0 forks source link

hyper client lifetime issue #7

Closed jgraef closed 3 months ago

jgraef commented 5 months ago

I had to remove an unnecessary 'static lifetime bound in hyper, so that we can mut-borrow connections to it. Currently the socks server needs this, because it wants to shut down the connections once the layer stack is done. But it is generally better not to require the connection to be static.

The workspace Cargo.toml contains a patch section to use my fix:

[patch.crates-io]
hyper = { git = "https://github.com/jgraef/hyper.git", branch = "non-static-client-io" }

Once the PR is merged upstream (and released), we can remove that patch.

jgraef commented 5 months ago

non-static IO might actually interfere with protocol upgrades. hyper can only create Upgraded for static IO, because the IO object is sent through an oneshot channel. I'm not sure how it compiles with non-static IO - and servers didn't require a static lifetime even before my patch.

jgraef commented 5 months ago

I found more unnecessary and annoying trait/lifetime bounds and removed them. I didn't open a PR, but might later. For now we can just use the patch with my forked repo.

jgraef commented 3 months ago

Changes have been merged into hyper.