{"id":101053,"date":"2022-08-09T09:07:25","date_gmt":"2022-08-09T00:07:25","guid":{"rendered":"https:\/\/softantenna.com\/blog\/?p=101053"},"modified":"2022-08-09T09:07:25","modified_gmt":"2022-08-09T00:07:25","slug":"bashttp","status":"publish","type":"post","link":"https:\/\/softantenna.com\/blog\/bashttp\/","title":{"rendered":"bashttp - \u8d85\u30b7\u30f3\u30d7\u30eb16\u884c\u306eBash\u88fdWeb\u30b5\u30fc\u30d0\u30fc"},"content":{"rendered":"<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/08\/spider-web-with-water-beads-network-dewdrop.jpeg\" alt=\"Spider web with water beads network dewdrop\" title=\"spider-web-with-water-beads-network-dewdrop.jpeg\" border=\"0\" width=\"1125\" height=\"750\" \/><\/p>\n<p>\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306b\u306a\u304f\u3066\u306f\u306a\u3089\u306a\u3044\u5b58\u5728\u306e\u300cWeb\u30b5\u30fc\u30d0\u30fc\u300d\u3002Apache\u3084Nginx\u7b49\u306e\u591a\u6a5f\u80fd\u306aWeb\u30b5\u30fc\u30d0\u30fc\u306f\u5927\u5909\u8907\u96d1\u306a\u69cb\u9020\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u57fa\u672c\u7684\u306a\u8003\u3048\u65b9\u306f\u5927\u5909\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002<\/p>\n<p>\u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300c<a href=\"https:\/\/github.com\/EddySchauHai\/bashttp\">bashttp<\/a>\u300d\u306f\u3001Web\u30b5\u30fc\u30d0\u30fc\u306e\u30b7\u30f3\u30d7\u30eb\u3055\u3092\u5b9f\u8a3c\u3059\u308bBash\u88fd\u306eWeb\u30b5\u30fc\u30d0\u30fc\u3067\u3059\u3002\u57fa\u672c\u7684\u306a\u6a5f\u80fd\u3060\u3051\u3057\u304b\u5229\u7528\u3067\u304d\u306a\u3044\u3082\u306e\u306e\u3001\u308f\u305a\u304b16\u884c\u306eBash\u30b3\u30fc\u30c9\u3067\u3001Web\u30b5\u30fc\u30d0\u30fc\u306e\u57fa\u790e\u7684\u306a\u90e8\u5206\u3092\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u4f7f\u7528\u65b9\u6cd5\u3092\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n<h2>bashttp\u3092\u5b9f\u884c\u3057\u3066\u307f\u308b<\/h2>\n<p>bashttp\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092clone\u3057\u3001\u30d5\u30a9\u30eb\u30c0\u5185\u306eserver.sh\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<pre>\r\n$ git clone https:\/\/github.com\/EddySchauHai\/bashttp.git\r\n$ cd bashttp\r\n$ sh server.sh \r\n<\/pre>\n<p>Web\u30d6\u30e9\u30a6\u30b6\u3067\u300chttp:\/\/localhost:1337\u300d\u306b\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059\u3002<\/p>\n<p><img decoding=\"async\" style=\"display:block; margin-left:auto; margin-right:auto;\" src=\"https:\/\/softantenna.com\/blog\/wp-content\/uploads\/2022\/08\/s_20220806_200604.jpg\" alt=\"S 20220806 200604\" title=\"s_20220806_200604.jpg\" border=\"0\" width=\"1007\" height=\"684\" \/><\/p>\n<p>\u25b2\u7d50\u679c\u304c\u8868\u793a\u3055\u308c\u307e\u3057\u305f\u3002\u4ed6\u306e\u7d50\u679c\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u304c\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3059\u308b\u30ec\u30b9\u30dd\u30f3\u30b9\u3068\u3057\u3066Web\u30d6\u30e9\u30a6\u30b6\u306b\u300cHello!\u300d\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>server.sh\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<pre>\r\n#!\/bin\/bash\r\n\r\ntrap \"echo Exited!; exit;\" SIGINT SIGTERM\r\n\r\nPORT=\"${1:-1337}\"\r\n\r\nmain () {\r\n    echo \"Starting...\"\r\n\r\n    while true \r\n    do\r\n        printf 'HTTP\/1.1 200 OK\\n\\n%s' \"$(cat index.html)\" | nc -c -l ${PORT}\r\n    done\r\n}\r\n\r\nmain\r\n<\/pre>\n<p>\u672c\u4f53\u306f\u7121\u9650\u30eb\u30fc\u30d7\u3067\u3001nc\u30b3\u30de\u30f3\u30c9\u3092\u5229\u7528\u3057\u3066\u30d6\u30e9\u30a6\u30b6\u3068\u30c7\u30fc\u30bf\u3092\u3084\u308a\u3068\u308a\u3057\u3066\u3044\u308b\u4e8b\u304c\u308f\u304b\u308a\u307e\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>bashttp\u306fBash\u30b9\u30af\u30ea\u30d7\u30c8\u88fd\u306e\u30b7\u30f3\u30d7\u30eb\u306aWeb\u30b5\u30fc\u30d0\u30fc\u3067\u3059\u3002<a href=\"https:\/\/news.ycombinator.com\/item?id=32160500\">Hacker News<\/a>\u306b\u306fBash\u3067\u4f5c\u3089\u308c\u305f\u5225\u306eWeb\u30b5\u30fc\u30d0\u30fc\u3084\u3001\u4ed6\u306e\u8a00\u8a9e\u3067\u4f5c\u3089\u308c\u305f\u30b7\u30f3\u30d7\u30eb\u306aWeb\u30b5\u30fc\u30d0\u30fc\u306e\u60c5\u5831\u304c\u5bc4\u305b\u3089\u308c\u3066\u3044\u307e\u3059\u3002Web\u30b5\u30fc\u30d0\u30fc\u306b\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u306f\u3044\u304b\u304c\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30a4\u30f3\u30bf\u30fc\u30cd\u30c3\u30c8\u306b\u306a\u304f\u3066\u306f\u306a\u3089\u306a\u3044\u5b58\u5728\u306e\u300cWeb\u30b5\u30fc\u30d0\u30fc\u300d\u3002Apache\u3084Nginx\u7b49\u306e\u591a\u6a5f\u80fd\u306aWeb\u30b5\u30fc\u30d0\u30fc\u306f\u5927\u5909\u8907\u96d1\u306a\u69cb\u9020\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u304c\u3001\u305d\u306e\u57fa\u672c\u7684\u306a\u8003\u3048\u65b9\u306f\u5927\u5909\u30b7\u30f3\u30d7\u30eb\u3067\u3059\u3002 \u672c\u65e5\u7d39\u4ecb\u3059\u308b\u300cbashttp\u300d\u306f\u3001We [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":101105,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[66],"tags":[4558,2915],"class_list":["post-101053","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webservice","tag-bashhttp","tag-http"],"_links":{"self":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/101053","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/comments?post=101053"}],"version-history":[{"count":0,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/posts\/101053\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media\/101105"}],"wp:attachment":[{"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/media?parent=101053"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/categories?post=101053"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softantenna.com\/blog\/wp-json\/wp\/v2\/tags?post=101053"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}