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

fix: Use local port to avoid triggering the firewall #1833

Merged
merged 1 commit into from Feb 11, 2020

Conversation

Rob--W
Copy link
Member

@Rob--W Rob--W commented Feb 7, 2020

When web-ext run starts, the following prompt shows briefly on macOS:

Do you want the application "node" to
accept incoming network connections?

This is because we use listen(0) to find a port, and by default, this
method listens on any network interface.

Since we are only looking for free ports and not network connections,
limit listen() to localhost only.

@Rob--W Rob--W requested a review from rpl February 7, 2020 13:14
@rpl
Copy link
Member

rpl commented Feb 7, 2020

@Rob--W it looks that the CI job is currently failing because flow expects a different function signature:
https://travis-ci.org/mozilla/web-ext/jobs/647323742#L241-L257

I haven't tried to apply the change locally, but it may be enough to pass an explicit undefined as the third parameter that flow expects (backlog) and pass the callback as the forth parameter.

@Rob--W
Copy link
Member Author

Rob--W commented Feb 7, 2020

This is a common signature, so I'll submit a PR against flow. Then we can merge it in #1746.

@Rob--W
Copy link
Member Author

Rob--W commented Feb 7, 2020

Patch is up at facebook/flow#8290

When `web-ext run` starts, the following prompt shows briefly on macOS:

> Do you want the application "node" to
> accept incoming network connections?

This is because we use `listen(0)` to find a port, and by default, this
method listens on any network interface.

Since we are only looking for free ports and not network connections,
limit `listen()` to localhost only.
@Rob--W
Copy link
Member Author

Rob--W commented Feb 11, 2020

I added a FLOW_FIXME comment. flow is supposed to support us in making our code better, not block us from landing otherwise good patches.

Once my upstream patch is merged, I'll follow up here.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 55bc11c on Rob--W:port-listen-local-only into 4c612ee on mozilla:master.

@rpl
Copy link
Member

rpl commented Feb 11, 2020

I added a FLOW_FIXME comment. flow is supposed to support us in making our code better, not block us from landing otherwise good patches.

Once my upstream patch is merged, I'll follow up here.

Sure, I was going to suggest that too, no need to wait for the upstream fix for just the two places we had to mark with the flow fixme annotation.

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

Successfully merging this pull request may close these issues.

None yet

3 participants