Skip to content

Instantly share code, notes, and snippets.

@asufana
Last active October 18, 2016 13:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save asufana/7d68c95ccc83dad4eb5a62ecd8ee6c71 to your computer and use it in GitHub Desktop.
Save asufana/7d68c95ccc83dad4eb5a62ecd8ee6c71 to your computer and use it in GitHub Desktop.
お手軽HTTPサーバ公開

お手軽HTTPサーバ公開

Pythonの標準モジュールとngrokを利用して、インターネットにHTTP/HTTPSコンテンツを公開する

1. HTTPサーバ起動

$ touch hello.html
$ vim hello.html
$ python -m SimpleHTTPServer 8080
Serving HTTP on 0.0.0.0 port 8080 ...

起動確認として http://localhost:8080/hello.html にアクセスする

2. HTTPサーバ公開

$ brew cask install ngrok
$ ngrok http 8080
Session Status                online          
Version                       2.1.14          
Region                        United States (us)
Web Interface                 http://127.0.0.1:4040
Forwarding                    http://c1d63c34.ngrok.io -> localhost:8080
Forwarding                    https://c1d63c34.ngrok.io -> localhost:8080

公開確認として http://c1d63c34.ngrok.io/hello.html にアクセスする

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment