How to run meteor server on a different ip address?

前端 未结 9 1823
悲哀的现实
悲哀的现实 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:13

    Using Meteor 1.3.2.4, If your IP is 192.168.0.13 as in my case, on the terminal, type:

    meteor --mobile-server 192.168.0.13
    

    or

    meteor --port 192.168.0.13:3000
    

    And you will see the Meteor welcome page by typing

    http://192.168.0.13:3000
    

    on your browser.

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

    Deploy it on another server and connect to the internet-ip of the server from outside of the internal net, or connect to the local-ip of the server from the lan.

    How to deploy on another server?

    'meteor bundle'

    and read the README

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

    At the moment, you can't - meteor binds to all IP addresses, but there's an issue open to add support for binding to a specific IP.

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

    If you are looking to run something on another IP address (but still have the files local) you need to look into editing your vhosts file. If you are on a mac, look into Virtual Host X

    The proper way to change ports with meteor is this:

    meteorapp : meteor --port 5000
    
    0 讨论(0)
  • 2020-12-03 00:21

    According to netstat -tapn Meteor/Node.js listens on all available IP addresses on the machine:

    tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      9098/node
    

    Do you have something like iptables running?

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

    Actually, Meteor behaves differently in production and development environments.

    Production

    Use environment variable BIND_IP

    Development

    Use --port argument like meteor run --port 192.168.1.1:port

    Docs here

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