参考此页面:
它说你可以远程端口转发 LiveReload 特定的 35729,使用以下命令:
ssh -L 35729:127.0.0.1:35729 mylogin@myremoteserverIP
当我运行 -v 选项时,我得到:
debug1: Local connections to LOCALHOST:35729 forwarded to remote address 127.0.0.1:35729 debug1: Local forwarding listening on ::1 port 35729.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 35729.
debug1: channel 1: new [port listener]
debug1: channel 2: new [client-session]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: client_input_channel_req: channel 2 rtype [email protected] reply 1
debug1: Connection to port 35729 forwarding to 127.0.0.1 port 35729 requested.
debug1: channel 3: new [direct-tcpip]
channel 3: open failed: connect failed: Connection refused
debug1: channel 3: free: direct-tcpip: listening port 35729 for 127.0.0.1 port 35729, connect from 127.0.0.1 port 63673, nchannels 4
我以为用这一行编辑我的 /etc/services 就可以了,但是却不行:
livereload 35729/tcp # livereload usage with guard-livereload
每次我尝试连接浏览器扩展时,我都认为它被我的服务器阻止了。我在这里遗漏了什么?我需要编辑 /etc/services 才能使其正常工作吗?
答案1
这里我们看到了问题:
channel 3: open failed: connect failed: Connection refused
这意味着远程主机上没有任何内容监听端口 35729,或者您对本地主机设置了防火墙(可能性不大)。
尝试启动 Guard 并确保它确实在监听该端口。