WIP: Allow http upgrades w/o using connect method.#207
WIP: Allow http upgrades w/o using connect method.#207dmwilcox wants to merge 2 commits intotinyproxy:masterfrom
Conversation
|
your commit doesn't even compile. maybe you can start with explaining what your plan is ? |
|
Sorry about that, I had a missing comma it should compile now. The idea behind the PR is issue #101 -- which from my testing is really just some websocket libraries not using CONNECT to setup the connection. Instead they assume an old HTTP/1.0 style proxy where setting the 'Host' header is all that's needed to setup the connection. Tinyproxy, as you know, when not using connect assumes HTTP/1.0 and adds a I added an config file option to Tinyproxy to support this antique proxy behavior and called it "AllowUpgrade" -- better name suggestions welcome. I just tested it and it works as expected for me -- I can pretend to be a bad websocket client and just make a request (no CONNECT) and get a status code 101 in response. I've been using curl (without -p which turns on the connect method) to simulate setting up a websocket and monitoring what hits the wire with wireshark. And I can drive it via netcat and get a proper upgrade now. Running tinyproxy on 10.137.0.14 port 3128 with the new build Couple of things I'd like some pointers on:
Thanks! |
|
sorry, i don't think it's a good idea to add a new config option for something that should work out of the box, and especially an option that requires a warning "only use if you know what you're doing". therefore i prepared a PR which should the solve the issue cleanly. please check if my pr #211 works for you, thanks! |
Per my comment on #101
Still having mild issues with the configuration file option doing what is expected. Let me know if I should move the lists of headers in
reqs.h, how to not warn on my bad pointer casting at compile time, or any other style or bad things I'm doing.Thank you for working on such an awesomely readable little proxy! I really enjoyed the process of re-visiting C.