0

Binding Mojito to another address

Mojito always starts bound to 127.0.0.1. I can't see a way to bind it to 0.0.0.0. Anyone know how to change the address?

by
9 Replies
  • Hi Jesse:

    It's the first argument on the command line: $ mojito start 8080

    See http://developer.yahoo.com/cocktails/mojito/docs/reference/mojito_cmdline.html#starting-the-server

    1
  • Ren that sets the port not the address.

    0
  • Oh so sorry I misread your email.

    I think the startup message is wrong; I'm running Node8/RHEL6 and it's clearly bound to 0.0.0.0 -- although at startup it says 127.1.

    $ mojito start Mojito(v0.5.6) started 'hello_world' on http://127.0.0.1:8666/

    $ netstat -an | grep 8666 tcp 0 0 0.0.0.0:8666 0.0.0.0:* LIST

    And I can get to the app from another machine.

    0
  • Oh so sorry I misread your email.

    I think the startup message is wrong; I'm running Node8/RHEL6 and it's clearly bound to 0.0.0.0 -- although at startup it says 127.1.

    $ mojito start &
    Mojito(v0.5.6) started 'hello_world' on http://127.0.0.1:8666/
    
    $ netstat -an | grep 8666
    tcp        0      0 0.0.0.0:8666                0.0.0.0:*                   LISTEN
    tcp        0      0 10.72.112.197:8666          10.73.145.150:63614         ESTABLISHED
    
    

    And I can get to the app from another machine.

    1
  • Filed https://github.com/yahoo/mojito/issues/1043

    0
  • Grrr Filed #1043

    0
  • Ah that would explain things. I'll try running my Mojito app directly on 80 without nginx tonight! And I would just like to say what a delight developing with Mojito has been. Definitely a hidden gem. The team definitely needs to be more active in blogging about their recent progress.

    0
  • Thanks @jesse, about blogging, we feel that it is almost there, we are making some big changes in the underlaying infrastructure (don't worry, we don't plan to break BC) to try to stabilize mojito/yui, then we plan to start blogging and try to grow are community.

    P.S. feedback are welcome, any pain point, feature, enhancement, whatever, just feel free to open issues at: https://github.com/yahoo/mojito/issues/new

    0
  • Hi @jesse, yes, the string "started on http://127.0.0.1" in the mojito start message is just hard-coded. It binds to your system's loopback address using express/connect which in turn extend the built-in node http. Unfortunately it's not configurable from the cli.

    From the docs, I think mojito's server should listen on any IP, and both 0.0.0.0:8666 and 127.0.0.1:8666 should work.. http://nodejs.org/api/http.html#http_server_listen_port_hostname_backlog_callback

    0

Recent Posts

in Yahoo! Mojito