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

Improvements to HTTP web proxy #742

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

IanLeeClaxton
Copy link

The current http proxy implementation has a few issues that I encountered when trying to implement behind a Squid proxy so we were unable to use it. This update should resolve the issues we encountered

Bug: proxy connect packet is malformed due to a space after HTTP/1.1.
Feature: Pass the host name so proxy host acls can be matched.
Feature: Switch to the WebRequest.DefaultWebProxy which allows for overriding in app.settings file and falls back to the system proxy if not configured.
Improvement: Use ordinal comparision for IndexOf on the proxy response.

@CLAassistant
Copy link

CLAassistant commented Sep 26, 2022

CLA assistant check
All committers have signed the CLA.

Bug: proxy connect packet is malformed due to a space after HTTP/1.1.
Feature: Pass the host name so proxy host acls can be matched.
Feature: Switch to the WebRequest.DefaultWebProxy which allows for overriding in app.settings file and falls back to the system proxy if not configured.
Improvement: Use ordinal comparision for IndexOf on the proxy response.
@gbirchmeier
Copy link
Member

Hi @IanLeeClaxton, is this still a "living" fix for you? If I rebase to latest, can you review and help me see it through to merge?

@IanLeeClaxton
Copy link
Author

Sure Grant, as far as I'm aware this is still being used at the company I wrote it for.

Let me know what you need me to do

@IanLeeClaxton
Copy link
Author

@gbirchmeier, I fixed the merge conflicts and this branch is ready for you to test/merge.

I recommend regression testing my changes again with a corporate class proxy and you could also automate testing using squid as part of your release pipeline.

@gbirchmeier
Copy link
Member

@IanLeeClaxton any chance you can tag or pass on a contact to someone at the company that's using it? If nothing else, I'd just like to let them know that this fix is going in.

@IanLeeClaxton
Copy link
Author

I have sent a DM to Vijay who works there and will ask him to confirm on this thread

@vijayn1
Copy link

vijayn1 commented Feb 22, 2024

@gbirchmeier - please proceed with this request. Thank you @IanLeeClaxton

@IanLeeClaxton
Copy link
Author

@gbirchmeier I have applied your recommendations to this PR

@VAllens
Copy link

VAllens commented Mar 2, 2024

This PR seems to have no problem.
Let's keep an eye on it !

@IanLeeClaxton IanLeeClaxton force-pushed the feature/improve-http-proxy branch 3 times, most recently from 95a786f to 69f2b21 Compare March 7, 2024 12:39
@@ -50,7 +50,7 @@ public static class StreamFactory
Socket socketThruProxy = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
socketThruProxy.Connect(proxyEndPoint);

string proxyMsg = $"CONNECT {destIp}:{destPort} HTTP/1.1 \n\n";
string proxyMsg = $"CONNECT {destHostName}:{destPort} HTTP/1.1\nHost: {destHostName}:{destPort}\n\n";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You never did answer my original question: Will this new string work seamlessly with existing non-Squid users?

Why was it using destIp before if that wasn't really needed? Was that just the wrong way to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants