Can’t reproduce (OSX 10.9.3).
Both curl calls work perfectly for me. Maybe its your curl?

Max

On 13.06.2014, at 21:32, Luc Fabresse <[email protected]> wrote:

> Hi,
> 
> I experiencing a strange difference between localhost and 127.0.0.1.
> 
> In Pharo I do:
> 
> (ZnServer startDefaultOn: 4444)
>       onRequestRespond: [ :request | ZnResponse ok: (ZnEntity text: 'hello') ]
> 
> In bash:
> 
> $ lsof -Pi | grep Pharo
> Pharo     2718  luc    7u  IPv4 0x1e64a2e9381f409b      0t0  TCP *:4444 
> (LISTEN)
> 
> I perfectly listen on port 4444 from all interfaces *
> 
> $ curl http://127.0.0.1:4444
> hello
> 
> $ curl http://localhost:4444
> curl: (7) Failed to connect to localhost port 4444: Connection refused        
>              <- why ?
> 
> localhost is correctly resolved on my mac
> $ ping localhost
> PING localhost (127.0.0.1): 56 data bytes
> 64 bytes from 127.0.0.1: icmp_seq=0 ttl=64 time=0.044 ms
> 
> I tested with other programs than Zinc to open listening sockets and it works.
> 
> Any idea?
> 
> #Luc

Reply via email to