question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-dev-utils/webpackHotDevClient - SockJS - non-customisable host and port

See original GitHub issue

Hello.

I have a question about the react-dev-utils/webpackHotDevClient.

SockJS there (see https://github.com/facebookincubator/create-react-app/blob/next/packages/react-dev-utils/webpackHotDevClient.js#L64) is instantiated with not customized host and port but with the corresponding parameters of the original window.

Is it intended and/or are there any strict contraindications against customizing host and port?

If yes, what’s the explanation? If not, would it make sense if I handle this issue and make a PR?

Thank you!

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AlexMiroshnikovcommented, Jan 16, 2018

@tharakawj Thank you for reaction. I do understand what happens on those lines.

If you want to customize port and host of the webpack dev server you can easily change them via environment variables.

Of course I know about this option, and I even use it, but imagine that I have another application which should be able to talk to the webpack dev server. Say, webpack dev server is available by localhost:3000 and I have, for example, anotherapp.local, and I want anotherapp.local to talk to the running webpack dev server, with hot replacement and all that useful things. With the current implementation, if works pretty fine until the moment Sock tries to connect to dev server - instead of establishing connection with localhost:3000, it tries ws://anotherapp.local and, of course, fails.

So why exactly not to customize the parameters?

0reactions
anasanzaricommented, Jan 14, 2019

+1

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found