python - 从 Virtual Box 外部访问 python SimpleHTTPServer

标签 python networking localhost virtualbox simplehttpserver

我正在虚拟框中运行 python SimpleHTTPServer。是否可以从主机访问它? 在我的主机中运行 ipconfig 给出了以下地址。我尝试在主机的浏览器中使用它,但这似乎不起作用。 我应该查看不同的 IP 地址吗?

  $> ipconfig

    Windows IP Configuration


    Ethernet adapter Ethernet 2:

       Media State . . . . . . . . . . . : Media disconnected
       Connection-specific DNS Suffix  . :

    Ethernet adapter VirtualBox Host-Only Network #2:

       Connection-specific DNS Suffix  . :
       Link-local IPv6 Address . . . . . : xx:xx:xx:xxxx:xxx:xxxx
       IPv4 Address. . . . . . . . . . . : 192.168.99.1
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Default Gateway . . . . . . . . . :

最佳答案

虚拟盒中的端口转发帮助解决了问题。

关于python - 从 Virtual Box 外部访问 python SimpleHTTPServer,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40616657/

相关文章:

Python提取包含单词的句子

python - 在 pandas 数据帧上逐行迭代,并有可能跳回

python - 更改包含最大值和最小值的列 python

mysql - 在 MEGA 上同步 MAMP MySQL 数据库

ipad - Google API-如何将URL重定向到我的本地主机

Python 命令行 "characters"返回 'characters'

java - 使同一 LAN 上的两个 Java 应用程序相互感知

c - 我需要一个标准包来通过网络连接移动键值对 : any tips?

java - 无法在 Linux 上使用 NetworkInterface.getNetworkInterfaces 获取所有网络接口(interface)

http - 使用 Anypoint Studio (MULE) 在本地主机上找不到资源