How to run meteor server on a different ip address?

前端 未结 9 1824
悲哀的现实
悲哀的现实 2020-12-02 23:51

How can i start meteor server on a different IP address? Currently in the examples am only able to run on a localhost:3000 address.

相关标签:
9条回答
  • 2020-12-03 00:26

    According to this change, you should be able to configure your app to bind to a specific IP address by configuring a BIND_IP environment variable.

    export BIND_IP=127.0.0.1
    

    You may need to update your app to a newer version of Meteor for this to work correctly.

    0 讨论(0)
  • 2020-12-03 00:33

    export BIND_IP no longer works, bind IP is defined with --port (or -p or --app-port) option(s):

    $ meteor run --port 127.0.0.1:3000
    

    Reference: https://github.com/meteor/meteor/commit/9b8bd31a7b6c857e5d8fc0393982e6e6b2973eb0

    0 讨论(0)
  • 2020-12-03 00:34

    This isn't possible yet, but there is an open pull request for it. They are waiting for the author to sign the meteor contributor agreement before it can be accepted.

    https://github.com/meteor/meteor/pull/469/

    If you need it before it's official you can apply the patch yourself (or potentially just replace 127.0.0.1 with the IP address you want to bind to in the same files references by the patch (app/lib/mongo_runner.js and app/meteor/run.js).

    0 讨论(0)
提交回复
热议问题