V
V
Vlad Chernik2016-05-25 11:15:11
ruby
Vlad Chernik, 2016-05-25 11:15:11

How to open hanami app in windows guest machine?

Good day everyone!
There is a guest machine on Win7 64bit and a host machine on Ubuntu Trusty 64bit.
Communication between machines is configured by means of Vagrant.
The contents of Vagrantfile in the forward ports part:

config.vm.network "forwarded_port", guest: 2300, host: 2300
config.vm.network "forwarded_port", guest: 3000, host: 3000

The project from the following guide has been created on the host machine .
I start the server:
[email protected]:/vagrant/hanami/bookshelf$ bundle exec hanami server
[2016-05-25 07:53:25] INFO  WEBrick 1.3.1
[2016-05-25 07:53:25] INFO  ruby 2.2.3 (2015-08-18) [x86_64-linux]
[2016-05-25 07:53:25] INFO  WEBrick::HTTPServer#start: pid=1842 port=2300

When I try to open the localhost:2300 page on the guest machine, I get errors: ERR_CONNECTION_RESET or ERR_SOCKET_NOT_CONNECTED.
When trying to run on the host machine, the
curl 'http://localhost:2300/'
content of the page in the form of html is returned, i.e. the server is running.
Tell me, please, what could be the reason? How to overcome this situation?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
OnYourLips, 2016-05-25
@vladchernik

WEBrick binds to 127.0.0.1, change to 0.0.0.0 (all network interfaces).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question