-
Notifications
You must be signed in to change notification settings - Fork 513
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
core/request.js: http proxies support #446
Conversation
To support http proxies path must accept url.
I'm not sure I understand why? |
Thanks this commit it will be able to use undici with http proxies. e.g.
There is |
That doesn't make sense to me... @szmarczak maybe you can help me understand? |
Okay, do you know the way how to use undici with proxy now? |
No because I don't understand what you are trying to do. I suspect you are looking for I don't see how your proposed change here would work. |
It works, I don't need to modify connect mechanics because I don't need to keep connection with proxy (tunneling). |
Can you add a test? |
Of course |
There are different methods to proxy the requests. The most popular is the |
It's almost the same as mirroring but you accept an absolute URL instead. |
@@ -23,8 +23,8 @@ class Request { | |||
upgrade, | |||
requestTimeout | |||
}, handler) { | |||
if (typeof path !== 'string' || path[0] !== '/') { | |||
throw new InvalidArgumentError('path must be a valid path') | |||
if (typeof path !== 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we have a regex that does a more strict check?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep,
let isURL = false;
try {
new URL(path);
isURL = true;
} catch {}
console.log(isURL);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (typeof path !== 'string' || (path[0] !== '/' && isURL === false))
@sergeysedoy97 @szmarczak Would either of you like to finish this PR? |
@sergeysedoy97 @szmarczak any of you still interested to continue this PR? |
Sure. Will do this now. |
test/tls.js fails randomly
|
To support http proxies path must accept url.
e.g.