-
Notifications
You must be signed in to change notification settings - Fork 145
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
release: 2.0.0 #162
release: 2.0.0 #162
Conversation
Co-authored-by: Martin Adámek <banan23@gmail.com>
Co-authored-by: Martin Adámek <banan23@gmail.com>
I have tested this manually and found no issues. Chain, Custom Response, Direct, Forward - they all work. IPv6 works as well (if upstream supports it, not all proxies do). |
awesome module! |
What errors are you seeing? |
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.
I'm pretty sure I won't find any issues now as all the PRs were reviewed individually. Let's wait for @jancurn's approval and then proceed with limited testing.
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.
I did a review of the new code. The code feels much much cleaner, it's broken down to more files, everything in TypeScript... in summary, definitely a big improvement, great work @szmarczak ! I didn't go into the lower-level details, I guess we'll have to gradually test it under heavier and heavier loads and see how it works.
Here are some comments:
- Altogether, the code is commented only very sparingly. A lot of functions don't have any comments, so you need to analyze the code to understand what they do. Sometimes their name doesn't say much too (e.g.
getBasic
,redactUrl
). When the functions are internal and are a few lines long, then it's fine, but sometimes they are longer or serve an important case, and then they should be commented. At the very least, all public methods ofServer
class should be commented, as well as core functions likechain
,handleCustomResponse
,direct
,forward
, ... - Please can you also update the CHANGELOG?
- It would be great if we could generate documentation of all the public classes and functions, now we have just README. Maybe in the next version...
- Are we using all the unit tests as we did in the past? I remember some things were commented out
Yep, all the tests pass. The commented out tests are now uncommented and pass as well :) |
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.
Agreed regarding the comments, while I understand the motivation behind removing comments that are not helpful, it does not mean we should have no comments :] At least public API should be documented.
It's always good to try to look at the comments from a newbie point of view, while it might feel moot for you, there still can be some value for newbies/newcomers.
Btw what about #160, is that addressed by the PR too?
I see it is, so the PR desc should contain the closes/fixes
part to link it (or is it enough like this, just fix
?).
I'm trying to write self explanatory code when possible.
They already are, not sure what you mean.
Done 👍🏼
On it.
Agreed. However generators are not so friendly. Most projects do docs by hand.
Already there ;) |
done
wip: simplify forward
skipped 2 tests (will re-enable once proxy-chain is fully rewritten)wip: simplify custom response
wip: simplify direct
wip: simplify chain
wip: simplify tools
parseUrl(...)
in favor ofnew URL(...)
parseHostHeader(...)
in favor ofnew URL(...)
isInvalidHeader(...)
(unused)findFreePort
in favor ofport: 0
redactUrl
addHeader
(leftover from wip: simplify chain #156)There's a slight behavior change in
parseAuthorizationHeader
. It now returns{ type: '', data: '' }
(instead ofnull
) if theproxy-authorization
header is invalid.wip: simplify tunnel
TcpTunnel
https://blog.apify.com/tunneling-arbitrary-protocols-over-http-proxy-with-static-ip-address-b3a2222191ff/direct
andchain
into objectwip: simplify server
other
createTunnel
#160wip: move to TypeScript