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

feat(hmr-ws-port): adds ability to explicitly set hmr ws port #450

Merged
merged 8 commits into from
Jan 1, 2018

Conversation

ksafranski
Copy link
Contributor

This PR is to address issues from #279 in allowing a specific port to be set for the HMR websocket. This allows the use, either in containers, behind firewalls, or in other circumstances where allowing broad port access is not viable, to specifically set the port:

-w, --websocket-port <port>    set the port to serve HMR websockets, defaults to random

Ensured non-breaking by defaulting to 0 as was previously hard-coded into the WS and HMR configuration.

src/cli.js Outdated
@@ -13,6 +13,11 @@ program
'set the port to serve on. defaults to 1234',
parseInt
)
.option(
'-w, --websocket-port <port>',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we call the option --hmr-port so it's clear what websocket is being referred to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, do you want it to be -h, --hmr-port?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good.

src/HMRServer.js Outdated
@@ -2,9 +2,9 @@ const WebSocket = require('ws');
const prettyError = require('./utils/prettyError');

class HMRServer {
async start() {
async start(websockerPort) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

misspelled. just call it port.

@devongovett devongovett merged commit 065a49e into parcel-bundler:master Jan 1, 2018
@ksafranski ksafranski deleted the feat-hmr-ws-port branch January 1, 2018 19:20
devongovett pushed a commit that referenced this pull request Oct 15, 2018
* feat(hmr-ws-port): adds ability to explicitly set hmr ws port

* fix(conflict): fix merge conflict

* fix(hmr-ws-port): change args, misc cleanup

* fix(hmr-ws-port): add args to cli
devongovett pushed a commit that referenced this pull request Oct 15, 2018
* feat(hmr-ws-port): adds ability to explicitly set hmr ws port

* fix(conflict): fix merge conflict

* fix(hmr-ws-port): change args, misc cleanup

* fix(hmr-ws-port): add args to cli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants