使用局域网中的移动设备连接到本地构建的Jekyll服务器 [英] Connect to a locally built Jekyll Server using mobile devices in the LAN
问题描述
在一台机器上使用 但是,我想知道如何从局域网中的其他机器访问此Web服务器,尤其是移动设备?我试图在将代码推送到Github之前在移动设备上测试jekyll站点。 试试 这将使Jekyll的HTTP服务器绑定到所有可用的IP地址,而不仅仅是 您也可以将它添加到 没有 但是 After using However, I'm wondering how to access this web server from other machines in the LAN, especially for mobile devices? I'm trying to test the jekyll site on mobile devices before pushing the code to Github. Try That will make Jekyll's HTTP server bind to all available IPs, rather than just to You can also add this to your Without But with
这篇关于使用局域网中的移动设备连接到本地构建的Jekyll服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! jekyll serve
后,会建立一个WEBrick服务器,并且可以从 localhost:4000 $ c
jekyll serve --host = 0.0.0.0
当你在命令行调用Jekyll时。
localhost
。
_config.yml
与主机:0.0.0.0
。 GitHub会在推送时忽略这一点,所以如果您不介意在网络上公开访问您的工作,则可以安全使用。
- host = 0.0.0.0
当你启动时,Jekyll会输出这样的内容:
$ jekyll服务
[...]
服务器地址:http://127.0.0.1:4000/
服务器正在运行...新闻ctrl-c停止。
- host = 0.0.0.0
(或 host:0.0.0.0
in _config.yml
),您会注意到它正在监听所有接口由 0.0.0.0
)表示,而不仅仅是监听环回接口(由 127.0.0.1
表示)
$ jekyll serve --host = 0.0.0.0
[...]
服务器地址:http:/ /0.0.0.0:4000/
服务器正在运行...按下ctrl-c停止。
jekyll serve
on one machine, a WEBrick server is set up and the site can be accessed from localhost:4000
on this particular PC.jekyll serve --host=0.0.0.0
when you invoke Jekyll on the command line.localhost
._config.yml
with host: 0.0.0.0
. GitHub will simply ignore this when you push, so it's safe to use if you don't mind having your work openly accessible on your network.
--host=0.0.0.0
Jekyll will output something like this when you start up:$ jekyll serve
[...]
Server address: http://127.0.0.1:4000/
Server running... press ctrl-c to stop.
--host=0.0.0.0
(or host: 0.0.0.0
in _config.yml
) you'll notice that it's listening on all interfaces (represented by 0.0.0.0
) rather than just listening on the loopback interface (represented by 127.0.0.1
)$ jekyll serve --host=0.0.0.0
[...]
Server address: http://0.0.0.0:4000/
Server running... press ctrl-c to stop.