ruby - Boot up rails app, make request to app from outside local network -


i'm sure pretty basic question, not find answer it. looked @ this question, this question, this question, this question, , this question , none of them helped me reach answer.

i using rails 4.2. created simple app test out if following:

i wanted see if possible me boot rails app on computer, , access app outside of local network. example: phone (which not connected local network) want make request , response.

i assumed first needed external/routable ip address. realize ip address isp provides router not static, demo purposes wanted see if make single request.

i went google , typed in "what ip" , came external ip address (let's pretend external ip address is: 11.111.111.111).

within rails app: did following command:

rvmsudo rails s -p 80 -b 11.111.111.111  

i want bind external ip address, , want listen on port 80. rvmsudo because, understand it, ports below 1000 require higher privileges.

it errors out , says following:

can't assign requested address - bind(2)

i trying understand why erroring out. not understanding? missing step? not possible this? isp making cannot bind external ip? need additional configuration on router?

i realize use heroku. more of experiment see if possible. in advance!

you can not bind socket external ip. ip assigned modem (or whatever use connect internet) isp. can bind interfaces of computer.

there multiple solutions:

  • bind 0.0.0.0:3000 (or computers ip, not localhost) , make sure network forwards public ip computer on port.
  • use https://ngrok.com/ easy , simple

Comments

Popular posts from this blog

javascript - Thinglink image not visible until browser resize -

firebird - Error "invalid transaction handle (expecting explicit transaction start)" executing script from Delphi -

mongodb - How to keep track of users making Stripe Payments -