Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

guard livereload using ipv4 only . how to force to use ipv6. #174

Open
devprashant opened this issue Apr 2, 2017 · 1 comment
Open

guard livereload using ipv4 only . how to force to use ipv6. #174

devprashant opened this issue Apr 2, 2017 · 1 comment

Comments

@devprashant
Copy link

devprashant commented Apr 2, 2017

on server allowed to use only ipv6 for connection inbound and outbound.

netstat --listen output:


Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 *:ssh                   *:*                     LISTEN     
tcp        0      0 *:35729                 *:*                     LISTEN     
tcp6       0      0 [::]:ssh                [::]:*                  LISTEN     
tcp6       0      0 [::]:3000               [::]:*                  LISTEN     
Active UNIX domain sockets (only servers)
Proto RefCnt Flags       Type       State         I-Node   Path
unix  2      [ ACC ]     STREAM     LISTENING     1185713259 @/com/ubuntu/upstart
unix  2      [ ACC ]     SEQPACKET  LISTENING     1185708161 /run/udev/control

here is the guardfile:

guard 'livereload', host:'0.0.0.0' do
 watch %r{^.*\.(html|css|js|png|jpg|jade)$}
end

here i do need to mention host specifically.

from netstat its visible guard binds livereload to ipv4 and not ipv6.

how to bind it to ipv6

@ybart
Copy link

ybart commented Dec 8, 2020

Provided you have these two lines in your /etc/hosts

127.0.0.1       localhost
::1                 localhost

Binding to localhost in the Guardfile like this bound to ipv6 in my case (macOS):

guard 'livereload', host: 'localhost' do
  ...

Then I get this in is lsof:

lsof -i:35729       
COMMAND           PID  USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
com.apple.WebKi   588 ybart   93u  IPv6 0x4571d672b83d719f      0t0  TCP localhost:59214->localhost:35729 (ESTABLISHED)
com.apple.WebKi   588 ybart   98u  IPv6 0x4571d672b83d719f      0t0  TCP localhost:59214->localhost:35729 (ESTABLISHED)
ruby            49803 ybart   15u  IPv6 0x4571d672bbb7ad1f      0t0  TCP localhost:35729 (LISTEN)
ruby            49803 ybart   19u  IPv6 0x4571d672b83d941f      0t0  TCP localhost:35729->localhost:59214 (ESTABLISHED)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants