http.server<\/a> \u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n\u516c\u5f0f\u306e\u8b66\u544a\u306b\u3082\u3042\u308b\u3088\u3046\u306b\u3001\u5b9f\u904b\u7528\u5411\u3051\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u306a\u3044\u306e\u3067\u3001\u3042\u304f\u307e\u3067\u624b\u5143\u306e\u78ba\u8a8d\u7528\u7a0b\u5ea6\u306e\u3082\u306e\u3068\u3044\u3046\u8a8d\u8b58\u3067\u3002<\/p>\n
\u5b9f\u884c<\/h2>\n
\u3082\u3061\u308d\u3093 http.server \u3092\u4f7f\u3063\u3066 Python \u306e\u30b3\u30fc\u30c9\u3092\u66f8\u304d\u3001\u5b9f\u884c\u3059\u308c\u3070\u30b5\u30fc\u30d0\u3092\u7acb\u3066\u3089\u308c\u308b\u306e\u3067\u3059\u304c\u3001\u305d\u308c\u3067\u306f\u5c11\u3057\u9762\u5012\u3067\u3059\u3002<\/p>\n
\u3053\u3053\u3067\u306f Python \u306e\u30e2\u30b8\u30e5\u30fc\u30eb\u30e2\u30fc\u30c9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b3\u30de\u30f3\u30c9\u3067\u30b5\u30fc\u30d0\u3092\u7acb\u3061\u4e0a\u3052\u307e\u3057\u3087\u3046\u3002
\n\u30e2\u30b8\u30e5\u30fc\u30eb\u30e2\u30fc\u30c9\u3067\u8d77\u52d5\u3059\u308b\u306b\u306f Python \u306e\u5b9f\u884c\u30aa\u30d7\u30b7\u30e7\u30f3\u3068\u3057\u3066 -m<\/code> \u3092\u4ed8\u4e0e\u3057\u3001\u4f7f\u7528\u3059\u308b\u30e2\u30b8\u30e5\u30fc\u30eb http.server<\/code> \u3092\u6307\u5b9a\u3057\u307e\u3059\u3002<\/p>\n\u3064\u307e\u308a\u3001\u5b9f\u884c\u30b3\u30de\u30f3\u30c9\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n
$ python -m http.server<\/code><\/pre>\n\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u5916\u90e8\u30a2\u30af\u30bb\u30b9\u8a31\u53ef\uff08 0.0.0.0<\/code> \uff09\u306e 8000<\/code> \u756a\u30dd\u30fc\u30c8\u3067\u7acb\u3061\u4e0a\u304c\u308a\u307e\u3059\u3002<\/p>\n\u30a2\u30c9\u30ec\u30b9\u3068\u30dd\u30fc\u30c8\u306e\u5909\u66f4<\/h2>\n
\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306e\u30d8\u30eb\u30d7\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n
$ python -m http.server -h\nusage: server.py [-h] [--cgi] [--bind ADDRESS] [--directory DIRECTORY] [port]\n\npositional arguments:\n port Specify alternate port [default: 8000]\n\noptional arguments:\n -h, --help show this help message and exit\n --cgi Run as CGI Server\n --bind ADDRESS, -b ADDRESS\n Specify alternate bind address [default: all\n interfaces]\n --directory DIRECTORY, -d DIRECTORY\n Specify alternative directory [default:current\n directory]<\/code><\/pre>\n\u3053\u3053\u306b\u3042\u308b\u3088\u3046\u306b --bind<\/code> \u3067\u30a2\u30c9\u30ec\u30b9\u3092\u6307\u5b9a\u3059\u308b\u3068\u3001\u5916\u90e8\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u305b\u305a\u3001\u5b8c\u5168\u30ed\u30fc\u30ab\u30eb\u3067\u7acb\u3061\u4e0a\u3052\u305f\u308a\u3001\u30dd\u30fc\u30c8\u756a\u53f7\u3092\u6307\u5b9a\u3057\u305f\u308a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\u4f8b\u3048\u3070\u3001\u30ed\u30fc\u30ab\u30eb\u3067 12345<\/code> \u756a\u30dd\u30fc\u30c8\u306b\u3057\u305f\u3044\u6642\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b3\u30de\u30f3\u30c9\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n$ python -m http.server --bind 127.0.0.1 12345<\/code><\/pre>\n\u304a\u308f\u308a\u306b<\/h2>\n
CGI \u30b5\u30fc\u30d0\u3068\u3057\u3066\u3082\u52d5\u304b\u305b\u308b\u306e\u3067\u3001\u5358\u7d14\u306a\u9759\u7684\u30b5\u30a4\u30c8\u610f\u5916\u306b\u3082\u4f7f\u3044\u9053\u306f\u3042\u308a\u305d\u3046\u3067\u3059\u306d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
\u306f\u3058\u3081\u306b \u624b\u5143\u3067\u7c21\u6613\u7684\u306a HTTP \u30b5\u30fc\u30d0\u3092\u7acb\u3066\u305f\u3044\u3068\u304d\u306b\u3088\u304f Python \u3092\u4f7f\u3044\u307e\u3059\u3002\u306a\u306e\u3067\u305d\u306e…<\/p>\n","protected":false},"author":1,"featured_media":411,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[14],"_links":{"self":[{"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/posts\/410"}],"collection":[{"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/comments?post=410"}],"version-history":[{"count":0,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/posts\/410\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/media\/411"}],"wp:attachment":[{"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/media?parent=410"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/categories?post=410"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.hgrs.me\/wp-json\/wp\/v2\/tags?post=410"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}