fix: proxy detection behind pf redirects#136
Open
yangshun wants to merge 1 commit intovercel-labs:mainfrom
Open
fix: proxy detection behind pf redirects#136yangshun wants to merge 1 commit intovercel-labs:mainfrom
yangshun wants to merge 1 commit intovercel-labs:mainfrom
Conversation
|
@yangshun is attempting to deploy a commit to the Vercel Labs Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes a false positive existing proxy check when
/etc/pf.confis modified.Background
I wanted to access my sites without any port numbers, so I modifed my
/etc/pf.confand added this linerdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 80 -> 127.0.0.1 port 1355After modifying it, I enabled
pfctlso that I can access at my app athttp://myapp.localhost, which gets routed tohttp://myapp.localhost:1355:This worked fine. But after I stopped the portless proxy server, I could not start it again, and I get this error "Proxy failed to start (timed out)".
Things recovered after disabling
pfctl:I could start
portlessagain like before.My changes to
/etc/pf.confledportlessto think that the proxy server is running when it isn't. I think this is a bug inportless.Fix
isProxyRunning()to reject PF/NAT redirect false positives when the probed port differs from the actual listener portTesting
pnpm --filter portless testpnpm --filter portless typecheckpnpm --filter portless build