Giter Site home page Giter Site logo

Add option to bind host to 0.0.0.0 about sirv HOT 4 CLOSED

lukeed avatar lukeed commented on August 21, 2024
Add option to bind host to 0.0.0.0

from sirv.

Comments (4)

lukeed avatar lukeed commented on August 21, 2024 10

Hey, thanks

So I took care of --host, -H support. While I was at it, I added support for HOST and PORT environment variables, which also should have been there.

These options are now available in [email protected]:

$ PORT=3000 sirv public
$ HOST=0.0.0.0 sirv public
$ sirv public --host 10.0.0.1

from sirv.

LySofDev avatar LySofDev commented on August 21, 2024

Unless you have a reason not too, you could probably add the option and pass the host as the second argument to the server.listen call.

server.listen(port, err => {

Node docs indicate that the second optional argument is the host.

https://nodejs.org/api/net.html#net_server_listen

from sirv.

lukeed avatar lukeed commented on August 21, 2024

Yes, for sure! I thought it was in there already but guess not.

I'll get it in tonight unless you want to beat me to it. Currently away from my computer - back soon

from sirv.

LySofDev avatar LySofDev commented on August 21, 2024

Thanks! 👍

from sirv.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.