mock-server icon indicating copy to clipboard operation
mock-server copied to clipboard

Cannot access service by IP (localhost or 127.0.0.1 works)

Open surecc opened this issue 10 years ago • 6 comments

I can't access the service from my own IP, but 127.0.0.1 works can you tell me why and help me out?

when i start with :

mock-server --address=119.254.100.35 --dir=/root/mockServer

it occours:

Traceback (most recent call last): File "/usr/local/bin/mock-server", line 66, in main() File "/usr/local/bin/mock-server", line 60, in main server.bind(options.port, options.address) File "/usr/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 170, in bind backlog=backlog) File "/usr/local/lib/python2.7/site-packages/tornado/netutil.py", line 145, in bind_sockets sock.bind(sockaddr) File "/usr/local/lib/python2.7/socket.py", line 224, in meth return getattr(self._sock,name)(*args) socket.error: [Errno 99] Cannot assign requested address

surecc avatar Apr 02 '15 14:04 surecc

I can't access too

sanmaopep avatar Nov 11 '16 08:11 sanmaopep

You can use nginx to make a proxy.

sanmaopep avatar Nov 11 '16 10:11 sanmaopep

You can use nginx to make a proxy.

Thanks

sagespidy avatar Jan 08 '19 13:01 sagespidy

You can use nginx to make a proxy.

This is a good idea, but this bug needs to be fixed.

kdyzm avatar Jan 29 '19 08:01 kdyzm

Its not a bug, the server is only listening on the loop-back address, 127.0.0.1. Looks like there is a '--address' which you can use to specify the IP address to listen to.

golharam avatar May 07 '19 01:05 golharam

Try adding --address=0.0.0.0

DmitryAndreyeff avatar Feb 16 '21 17:02 DmitryAndreyeff