Add option allow external connections to npx gulp server#20646
Merged
calixteman merged 1 commit intomozilla:masterfrom Mar 9, 2026
Merged
Add option allow external connections to npx gulp server#20646calixteman merged 1 commit intomozilla:masterfrom
npx gulp server#20646calixteman merged 1 commit intomozilla:masterfrom
Conversation
2 tasks
calixteman
reviewed
Feb 10, 2026
Contributor
calixteman
left a comment
There was a problem hiding this comment.
You can add an option to handle whatever host:
https://github.com/mozilla/pdf.js/blob/master/gulpfile.mjs#L2096-L2144
timvandermeij
approved these changes
Feb 12, 2026
5d167f5 to
d19e935
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #20646 +/- ##
=========================================
Coverage ? 62.76%
=========================================
Files ? 169
Lines ? 120419
Branches ? 0
=========================================
Hits ? 75582
Misses ? 44837
Partials ? 0
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
npx gulp servernpx gulp server
Contributor
Author
|
@calixteman Is this what you meant? |
Contributor
I was imagining something like |
d19e935 to
8730598
Compare
timvandermeij
approved these changes
Mar 5, 2026
Contributor
timvandermeij
left a comment
There was a problem hiding this comment.
Looks good to me; thanks!
Using `0.0.0.0` instead of `localhost` allows connecting from other devices, significantly simplifying testing on mobile devices. This is controlled by the `--host` CLI flag and not enabled by default, since allowing external connections comes with security implications (e.g. when on a public network without a properly configured firewall). There might be reasons to want to listen on custom hostnames, but as the most common usage will probably be `--host 0.0.0.0`, there is a shorter alias `--host 0` for it.
8730598 to
384f1af
Compare
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.
Using
0.0.0.0instead oflocalhostallows connecting from otherdevices, significantly simplifying testing on mobile devices.
This is controlled by the
--any-hostCLI flag and not enabled bydefault, since allowing external connections comes with security
implications (e.g. when on a public network without a properly
configured firewall).