2017年5月29日 星期一

Enable Pyhton http.server, Leverage VM guest OS to access it.

1, Execute the following command in Host OS.
It will listen to 8000 port.
(Python 3.X) python -m http.server 8000
(Python 2.X) python -m SimpleHTTPServer 8000

2, Access guest OS. and type ifconfig to get its IP.
In this example, it is 192.168.80.129. Therefore we can use 192.168.80.1:8000 to access http service listened in host server.









3. Execute the following command in guest OS.
curl http://192.168.80.1:8000?test=1234

4. You can see the access log from guest OS.

沒有留言:

張貼留言