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

--host argument in CLI #80

Closed
meowgorithm opened this issue Dec 9, 2014 · 8 comments
Closed

--host argument in CLI #80

meowgorithm opened this issue Dec 9, 2014 · 8 comments

Comments

@meowgorithm
Copy link

It would be very useful to be able to bind the server to something other than localhost (0.0.0.0, for example) to allow other devices on the network to reach the dev server.

A common use case would be for testing on mobile devices.

@Kagami
Copy link

Kagami commented Dec 11, 2014

👍
Seems like it was already done by @wrobel in his fork: https://github.com/wrobel/webpack-dev-server/tree/feature/variablehostname
Also it's a good pratice to bind dev servers only to localhost by default (now webpack-dev-server listen on 0.0.0.0) because of the security measurements.

@meowgorithm
Copy link
Author

Oh, good to know! Would love to see this merged in.

And I agree completely about defaulting to localhost.

sokra added a commit that referenced this issue Dec 15, 2014
@madebyherzblut
Copy link

We are using webpack inside a virtual machine and it would be nice to bind it something else than localhost. So 👍

/edit: Never mind, I just realized the option is already available as of 1.7. Thanks!

@Kagami
Copy link

Kagami commented Dec 25, 2014

This feature was already merged and released, see: https://github.com/webpack/webpack-dev-server/commits/master (PR #83).

@meowgorithm
Copy link
Author

@Kagami when can we expect a release to NPM?

@Kagami
Copy link

Kagami commented Dec 26, 2014

I think it was already realesed: https://www.npmjs.com/package/webpack-dev-server (1.7.0)

@meowgorithm
Copy link
Author

@Kagami Ah, fantastic, looks like it just went up. Thanks!

@wrobel
Copy link
Contributor

wrobel commented Jan 8, 2015

Eh... I don't think my commit was ready for pulling :) Without actually transporting the hostname to the express server in the listen() call it will probably not bind to another host name.

This is probably required in line 114:

new Server(webpack(wpOpt), options).listen(argv.port, argv.host, function(err) {...

I'm sorry for leaving this unfinished. It was just a short attempt but I soon realized that I need a different approach to get the webpack-dev-server up and running.

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

No branches or pull requests

4 participants