LoginSignup
7
3

More than 5 years have passed since last update.

Windows VM で localhost:8000 をホストの 8000 に通す

Last updated at Posted at 2017-01-26

Mac 等で開発サーバを 8000 番ポートで立てていて、Windows の VM から http://localhost:8000/ でつなぎたい時のためのコマンドです。

Windows 側のコマンドプロンプトや PowerShell で実行できます。

netsh interface portproxy add v4tov4 listenport=8000 connectaddress=[ホストのIPアドレス]

例:
netsh interface portproxy add v4tov4 listenport=8000 connectaddress=192.168.1.3

http://localhost:8000/ なんてしなくても http://192.168.1.3:8000/ で事足りるのが普通だと思いますが、今回はどうしても localhost にしたかったのでこの方法を使いました。

参考:


(2017/01/30 追記)

7
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
3