{"id":1772,"date":"2024-04-23T17:04:32","date_gmt":"2024-04-23T08:04:32","guid":{"rendered":"https:\/\/edgecross.jp\/blog\/?p=1772"},"modified":"2024-07-03T20:29:28","modified_gmt":"2024-07-03T11:29:28","slug":"%e3%80%90inside-aiot%e3%80%91%e6%a9%9f%e6%a2%b0%e3%83%87%e3%83%bc%e3%82%bf%e3%83%a2%e3%83%8b%e3%82%bf%e3%83%aa%e3%83%b3%e3%82%b0%e3%81%ae%e6%a0%b8%e5%bf%83%e3%80%81%e3%83%aa%e3%82%a2%e3%83%ab%e3%82%bf","status":"publish","type":"post","link":"https:\/\/edgecross.jp\/blog\/tech\/1772\/","title":{"rendered":"\u3010Inside AIoT\u3011\u6a5f\u68b0\u30c7\u30fc\u30bf\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u306e\u6838\u5fc3\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0Web\u901a\u77e5SSE\u3092\u5b9f\u88c5\u3059\u308b"},"content":{"rendered":"\n<h2 class=\"wp-block-heading u-mb-ctrl u-mb-10\">\u306f\u3058\u3081\u306b<\/h2>\n\n\n\n<p>\u3053\u3093\u306b\u3061\u306f\uff01<br>\u6a5f\u68b0\u3068AI\u304c\u7e4b\u304c\u308b\u30b9\u30de\u30fc\u30c8\u306a\u88fd\u9020\u73fe\u5834\u3092\u4f5c\u3063\u3066\u3044\u308bEdgeCross\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u79c1\u305f\u3061\u306f\u3001\u5b9f\u969b\u306e\u73fe\u5834\u3067\u4f7f\u308f\u308c\u308bAI\u3068IoT\u6280\u8853\u306b\u3064\u3044\u3066\u3001\u3088\u308a\u591a\u304f\u306e\u65b9\u306b\u5206\u304b\u308a\u3084\u3059\u304f\u304a\u4f1d\u3048\u3059\u308b\u305f\u3081\u306bInside AIoT\u3092\u9023\u8f09\u3057\u3066\u3044\u307e\u3059\u3002<br><br>\u73fe\u5834\u3067\u30b9\u30de\u30fc\u30c8\u30de\u30b7\u30f3\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u5c0e\u5165\u3059\u308b\u969b\u3001\u6700\u3082\u6e80\u8db3\u5ea6\u304c\u9ad8\u3044\u6a5f\u80fd\u306e\u4e00\u3064\u304c\u3001\u7570\u5e38\u72b6\u6cc1\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u8fc5\u901f\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u901a\u77e5\u3059\u308b\u3053\u3068\u3067\u3059\u3002<br>\u4eca\u56de\u306f\u3001EdgeCross\u304c\u6a5f\u68b0\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u30fb\u9060\u9694\u5236\u5fa1\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3 Machine Manager(PROGIX, SCAUTR)\u3067\u3001\u3069\u306e\u3088\u3046\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u901a\u77e5\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u306e\u304b\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-wide\"\/>\n\n\n\n<p>\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u304cIoT\u30b7\u30b9\u30c6\u30e0\u3067\u6301\u3064\u91cd\u8981\u5ea6\u306f\u975e\u5e38\u306b\u5927\u304d\u3044\u3067\u3059\u3002<br>\u4eba\u304c\u7d99\u7d9a\u7684\u306b\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u3092\u5b9f\u884c\u3059\u308b\u306e\u306f\u9650\u754c\u304c\u3042\u308b\u305f\u3081\u3001EdgeCross\u306e\u30de\u30b7\u30f3\u30de\u30cd\u30fc\u30b8\u30e3\u30fc\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u5229\u7528\u3059\u308c\u3070\u3001\u30a6\u30a7\u30d6\u307e\u305f\u306f\u30a2\u30d7\u30ea\u3092\u901a\u3058\u3066\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u901a\u77e5\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br><br>\u30e6\u30fc\u30b6\u30fc\u306f\u81ea\u5206\u306e\u30de\u30b7\u30f3\u306e\u72b6\u614b\u3068\u73fe\u5834\u306e\u72b6\u6cc1\u306b\u5408\u308f\u305b\u3066\u901a\u77e5\u3092\u500b\u5225\u306b\u8a2d\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u30a6\u30a7\u30d6\/\u30a2\u30d7\u30ea\u3092\u901a\u3058\u3066\u91cd\u8981\u306a\u72b6\u614b\u30c7\u30fc\u30bf\u306e\u901a\u77e5\u3092\u53d7\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u3053\u306e\u3088\u3046\u306a\u901a\u77e5\u306f\u3001\u30a2\u30d7\u30ea\u30d7\u30c3\u30b7\u30e5\u3001SMS\u3001\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u901a\u77e5\u306e\u4e21\u65b9\u3067\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u307e\u3059\u3002<br>\u307e\u305f\u3001\u72b6\u6cc1\u306b\u5fdc\u3058\u3066\u69d8\u3005\u306a\u901a\u77e5\u30b5\u30fc\u30d3\u30b9\u3092\u8ffd\u52a0\u3067\u9078\u629e\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u672c\u8a18\u4e8b\u3067\u306f\u3001\u305d\u306e\u4e2d\u3067\u3082\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u3092\u901a\u3058\u305f\u901a\u77e5\u306e\u9001\u4fe1\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8a73\u3057\u304f\u8aac\u660e\u3057\u307e\u3059\u3002<br>\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u901a\u77e5\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u306e\u30d6\u30e9\u30a6\u30b6\u3092\u901a\u3058\u3066\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u60c5\u5831\u3092\u4f1d\u9054\u3059\u308b\u6a5f\u80fd\u3067\u3059\u3002<br>\u3053\u308c\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306f\u3044\u304f\u3064\u304b\u3042\u308a\u307e\u3059\u304c\u3001\u30a8\u30c3\u30b8\u30af\u30ed\u30b9\u306f<strong>Server-Sent Events(SSE)<\/strong>\u3068\u3044\u3046\u6280\u8853\u3092\u6d3b\u7528\u3057\u3066\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading u-mb-ctrl u-mb-10\">Server-Sent Events(SSE)\u3001\u6982\u5ff5\u304b\u3089\u78ba\u8a8d\u3059\u308b<\/h2>\n\n\n\n<p>Server-Sent Events(SSE)\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u30b5\u30fc\u30d0\u30fc\u306e\u6700\u521d\u306e\u63a5\u7d9a\u8981\u6c42\u3092\u3057\u305f\u5f8c\u3001\u5225\u9014\u306e\u8981\u6c42\u306a\u3057\u306b\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u6280\u8853\u3067\u3059\u3002<br>\u3053\u306e\u6280\u8853\u306f\u4e3b\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u901a\u77e5\u306e\u3088\u3046\u306a\u6a5f\u80fd\u3092\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u306b\u5b9f\u88c5\u3059\u308b\u969b\u306b\u6d3b\u7528\u3055\u308c\u307e\u3059\u3002<br>\u4f8b\u3048\u3070\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u65b0\u3057\u3044\u30e1\u30c3\u30bb\u30fc\u30b8\u3084\u66f4\u65b0\u3092\u5f85\u3064\u305f\u3073\u306b\u30b5\u30fc\u30d0\u30fc\u306b\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3059\u308b\u4ee3\u308f\u308a\u306b\u3001\u30b5\u30fc\u30d0\u30fc\u304c\u81ea\u52d5\u7684\u306b\u95a2\u9023\u60c5\u5831\u3092\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u9001\u4fe1\u3059\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\"><div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"1024\" height=\"466\" data-id=\"1773\" src=\"https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse01-1024x466.png\" alt=\"\" class=\"wp-image-1773\" srcset=\"https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse01-1024x466.png 1024w, https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse01-300x137.png 300w, https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse01-768x350.png 768w, https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse01.png 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading u-mb-ctrl u-mb-10\">SSE\u306e\u52d5\u4f5c\u539f\u7406<\/h2>\n\n\n\n<p>SSE\u306fHTTP\u30d7\u30ed\u30c8\u30b3\u30eb\u306b\u57fa\u3065\u3044\u3066\u52d5\u4f5c\u3057\u307e\u3059\u3002<br>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u5074\u306f<span class=\"swl-format-1\">\u3001<\/span><span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">EventSource<\/span><\/span>\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u4f7f\u7528\u3057\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u306e\u521d\u671f\u63a5\u7d9a\u3092\u958b\u59cb\u3057\u307e\u3059\u3002<br>\u3053\u306e\u63a5\u7d9a\u306fHTTP GET\u30ea\u30af\u30a8\u30b9\u30c8\u3067\u884c\u308f\u308c\u3001\u3053\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306f\u7279\u306b<span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">text\/event-stream<\/span><\/span>\u3068\u3044\u3046MIME\u30bf\u30a4\u30d7\u3092\u4f7f\u7528\u3057\u3066\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304cSSE\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u3053\u3068\u3092\u30b5\u30fc\u30d0\u30fc\u306b\u901a\u77e5\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u30b5\u30fc\u30d0\u30fc\u304c\u3053\u306e\u63a5\u7d9a\u8981\u6c42\u3092\u53d7\u3051\u4ed8\u3051\u308b\u3068\u3001\u63a5\u7d9a\u3092\u9589\u3058\u308b\u3053\u3068\u306a\u304f\u958b\u3044\u305f\u307e\u307e\u306b\u3057\u307e\u3059\u3002<br>\u3053\u306e\u3088\u3046\u306a\u7d99\u7d9a\u7684\u306a\u63a5\u7d9a\u306b\u3088\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u306f\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u304c\u767a\u751f\u3059\u308b\u305f\u3073\u306b\u3001\u30c6\u30ad\u30b9\u30c8\u30c7\u30fc\u30bf\u3092\u30a4\u30d9\u30f3\u30c8\u30b9\u30c8\u30ea\u30fc\u30e0\u5f62\u5f0f\u3067\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u9001\u4fe1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u5404\u30c7\u30fc\u30bf\u9001\u4fe1\u306f\u6b21\u306e\u5f62\u5f0f\u306b\u5f93\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code has-swl-gray-background-color has-background\"><code><span style=\"color:#986801\" class=\"swl-inline-color\">data<\/span>: <span style=\"color:#50a14f\" class=\"swl-inline-color\">Message\\\\n\\\\n<\/span><\/code><\/pre>\n\n\n\n<p>\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u4fe1\u3059\u308b\u305f\u3073\u306b\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306eEventSource\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306f\u3053\u308c\u3092\u691c\u77e5\u3057\u3001\u305d\u306e\u30c7\u30fc\u30bf\u3092onmessage\u30a4\u30d9\u30f3\u30c8\u3068\u3057\u3066\u51e6\u7406\u3057\u3066\u30e6\u30fc\u30b6\u30fc\u306b\u5fc5\u8981\u306a\u30a2\u30af\u30b7\u30e7\u30f3\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<br>\u3053\u306e\u30d7\u30ed\u30bb\u30b9\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3078\u306e\u4e00\u65b9\u5411\u306e\u901a\u4fe1\u3092\u53ef\u80fd\u306b\u3057\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\u5225\u9014\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u308b\u5fc5\u8981\u304c\u306a\u304f\u3001\u7d99\u7d9a\u7684\u306b\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading u-mb-ctrl u-mb-10\">SSE\u3068WebSocket\u306e\u7279\u5fb4\u3068\u9055\u3044<\/h2>\n\n\n\n<p>\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u901a\u4fe1\u306e\u305f\u3081\u306e\u3082\u3046\u4e00\u3064\u306e\u4e00\u822c\u7684\u306a\u65b9\u6cd5\u306f\u3001Websocket\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u3067\u3059\u3002<br>SSE\u3068Websocket\u306f\u305d\u308c\u305e\u308c\u72ec\u7279\u306a\u7279\u6027\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002<br>\u6700\u3082\u9855\u8457\u306a\u9055\u3044\u306f\u3001\u901a\u4fe1\u306e\u65b9\u5411\u6027\u306b\u3042\u308a\u307e\u3059\u3002<br>SSE\u306f\u4e00\u65b9\u5411\u901a\u4fe1\u3001\u3064\u307e\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u306e\u307f\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u65b9\u5f0f\u3067\u3059\u304c\u3001Websocket\u306f\u53cc\u65b9\u5411\u901a\u4fe1\u304c\u53ef\u80fd\u3067\u3001\u30b5\u30fc\u30d0\u30fc\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u304a\u4e92\u3044\u306b\u30c7\u30fc\u30bf\u3092\u9001\u53d7\u4fe1\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e2\u3064\u306e\u6280\u8853\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u9055\u3044\u3082\u91cd\u8981\u306a\u8003\u616e\u4e8b\u9805\u3067\u3059\u3002<br>SSE\u306f\u65e2\u5b58\u306eHTTP\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u5229\u7528\u3057\u3066\u63a5\u7d9a\u3092\u7dad\u6301\u3057\u3001\u30c7\u30fc\u30bf\u3092\u30b9\u30c8\u30ea\u30fc\u30e0\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u8ee2\u9001\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4e00\u65b9\u3001Websocket\u306f\u5225\u306eWebsocket\u30d7\u30ed\u30c8\u30b3\u30eb\u3092\u4f7f\u7528\u3057\u3066\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u4ea4\u63db\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<div class=\"wp-block-columns\">\n<div class=\"wp-block-column\" style=\"flex-basis:100%\">\n<figure class=\"wp-block-table aligncenter is-thead-centered is-style-regular min_width30_\"><table><thead style=\"--thead-color--bg:#fff;--thead-color--txt:var(--swl-text_color--black)\"><tr><th><\/th><th>Web Socket<\/th><th>SSE<\/th><\/tr><\/thead><tbody style=\"--tbody-th-color--bg:#9b9b9b;--tbody-th-color--txt:var(--swl-text_color--black)\"><tr><th><span class=\"swl-inline-color has-white-color\">\u30d6\u30e9\u30a6\u30b6<\/span><span class=\"swl-inline-color has-white-color\">\u30b5\u30dd\u30fc\u30c8<\/span><\/th><th><span class=\"swl-inline-color has-white-color\">\u307b\u3068\u3093\u3069\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u30b5\u30dd\u30fc\u30c8<\/span><\/th><th><span class=\"swl-inline-color has-white-color\">\u307b\u3068\u3093\u3069\u306e\u30d6\u30e9\u30a6\u30b6\u3067\u30b5\u30dd\u30fc\u30c8(polyfills\u53ef\u80fd)<\/span><\/th><\/tr><tr><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>\u901a\u4fe1\u65b9\u5411<\/td><td>\u53cc\u65b9\u5411<\/td><td>\u5358\u65b9\u5411<\/td><\/tr><tr><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0<\/td><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>O<\/td><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>O<\/td><\/tr><tr><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>\u30c7\u30fc\u30bf\u5f62\u5f0f<\/td><td>Binary\u3001UTF-8<\/td><td>UTF-8<\/td><\/tr><tr><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>\u81ea\u52d5\u518d\u63a5\u7d9a<\/td><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>X<\/td><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>O\uff083\u79d2\u6bce\u306b\u8a66\u884c\uff09<\/td><\/tr><tr><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>\u6700\u5927\u540c\u6642\u63a5\u7d9a\u6570<\/td><td>\u30d6\u30e9\u30a6\u30b6\u306e\u63a5\u7d9a\u5236\u9650\u306f\u306a\u3044\u304c\u3001\u30b5\u30fc\u30d0\u30fc\u306e\u30bb\u30c3\u30c8\u30a2\u30c3\u30d7\u306b\u3088\u3063\u3066\u7570\u306a\u308b<\/td><td>HTTP\u3092\u7d4c\u7531\u3059\u308b\u5834\u5408\u3001\u30d6\u30e9\u30a6\u30b6\u3042\u305f\u308a6\u500b\u307e\u3067\u53ef\u80fd \/ HTTP2\u3067\u306f100\u500b\u304c\u57fa\u672c\u3002<\/td><\/tr><tr><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>\u30d7\u30ed\u30c8\u30b3\u30eb<\/td><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>Websocket<\/td><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>HTTP<\/td><\/tr><tr><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>\u30d0\u30c3\u30c6\u30ea\u30fc\u6d88\u8cbb\u91cf<\/td><td>\u5927\u304d\u3044<\/td><td>\u5c11\u306a\u3044<\/td><\/tr><tr><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>Firewall\u30d5\u30ec\u30f3\u30c9\u30ea\u30fc<\/td><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>X<\/td><td data-has-cell-bg=\"1\" data-text-color=\"black\"><span class=\"swl-cell-bg has-swl-gray-background-color\" data-text-color=\"black\" aria-hidden=\"true\">&nbsp;<\/span>O<\/td><\/tr><\/tbody><\/table><\/figure>\n<\/div>\n<\/div>\n\n\n\n<p>EdgeCross\u306f\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u901a\u77e5\u6a5f\u80fd\u306e\u5b9f\u88c5\u306b\u304a\u3044\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3059\u308b\u4e00\u65b9\u5411\u306e\u901a\u4fe1\u306e\u307f\u304c\u5fc5\u8981\u306a\u305f\u3081\u3001SSE\u3092\u9078\u629e\u3057\u307e\u3057\u305f\u3002<br>SSE\u306fHTTP\u63a5\u7d9a\u3092\u30ea\u30b5\u30a4\u30af\u30eb\u3057\u3066\u30c7\u30fc\u30bf\u3092\u8ee2\u9001\u3059\u308b\u305f\u3081\u3001\u5225\u9014\u306e\u30d7\u30ed\u30c8\u30b3\u30eb\u30a4\u30f3\u30bf\u30fc\u30d5\u30a7\u30fc\u30b9\u3092\u5b9f\u88c5\u3057\u306a\u304f\u3066\u3082\u3001\u8fc5\u901f\u304b\u3064\u52b9\u7387\u7684\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306eWeb\u901a\u77e5\u6a5f\u80fd\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br>\u3053\u308c\u306b\u3088\u308a\u3001\u958b\u767a\u6642\u9593\u3068\u30b3\u30b9\u30c8\u3092\u524a\u6e1b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u65e2\u5b58\u306e\u30a6\u30a7\u30d6\u30a4\u30f3\u30d5\u30e9\u3068\u306e\u4e92\u63db\u6027\u3082\u9ad8\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading u-mb-ctrl u-mb-10\">SSE\u3092\u5229\u7528\u3057\u305fWeb\u30d6\u30e9\u30a6\u30b6\u901a\u77e5\u306e\u5b9f\u88c5<\/h2>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u5b9f\u969b\u306bEdgeCross\u306e\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3067\u901a\u77e5\u304c\u3069\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3055\u308c\u305f\u306e\u304b\u3001\u30b5\u30fc\u30d0\u30fc\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3001\u5b9f\u969b\u306e\u5b9f\u88c5\u6bb5\u968e\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u53c2\u8003\u306b\u3057\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"183\" src=\"https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse02-1024x183.png\" alt=\"\" class=\"wp-image-1780\" srcset=\"https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse02-1024x183.png 1024w, https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse02-300x54.png 300w, https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse02-768x137.png 768w, https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse02-1536x274.png 1536w, https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse02.png 2000w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u4e0a\u306e\u56f3\u306f\u3001\u73fe\u5728\u306e\u30a6\u30a7\u30d6\u901a\u77e5\u30b7\u30b9\u30c6\u30e0\u306e\u7c21\u5358\u306a\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u3067\u3059\u3002<\/p>\n\n\n\n<div class=\"swell-block-step is-style-small\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number\"><span class=\"__shape u-col-main\" role=\"presentation\"><\/span><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-m\">AIoT\u30c7\u30d0\u30a4\u30b9<\/div><div class=\"swell-block-step__body\">\n<p>\u6a5f\u68b0\u30c7\u30fc\u30bf\u3092\u53ce\u96c6\u3057\u3066\u51e6\u7406\u3057\u3001\u7279\u5b9a\u306e\u901a\u77e5\u30c7\u30fc\u30bf\u3092\u691c\u51fa\u3057\u307e\u3059\u3002\u691c\u51fa\u3055\u308c\u305f\u901a\u77e5\u30c7\u30fc\u30bf\u3092MQTT Broker\u306b\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number\"><span class=\"__shape u-col-main\" role=\"presentation\"><\/span><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-m\">MQTT\u30d6\u30ed\u30fc\u30ab\u30fc\u30b5\u30fc\u30d0\u30fc<\/div><div class=\"swell-block-step__body\">\n<p>\u3053\u306e\u30b5\u30fc\u30d0\u30fc\u306f\u3001AIoT\u30c7\u30d0\u30a4\u30b9\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3057\u3001\u4e8b\u524d\u306b\u5354\u8b70\u3055\u308c\u305f\u901a\u77e5\u30c8\u30d4\u30c3\u30af\u3067\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u308a\u307e\u3059\u3002\uff08MQTT\u306e\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001<a href=\"https:\/\/edgecross.jp\/blog\/tech\/952\/\" data-type=\"link\" data-id=\"https:\/\/edgecross.jp\/blog\/tech\/952\/\">\u3053\u3061\u3089\u306e\u8a18\u4e8b<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002\uff09<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number\"><span class=\"__shape u-col-main\" role=\"presentation\"><\/span><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-m\">\u30d7\u30c3\u30b7\u30e5\u30b5\u30fc\u30d0\u30fc<\/div><div class=\"swell-block-step__body\">\n<p>\u3053\u306e\u30b5\u30fc\u30d0\u30fc\u306f\u3001\u901a\u77e5\u30c8\u30d4\u30c3\u30af\u3092\u8cfc\u8aad\u3057\u3066\u304a\u308a\u3001\u65b0\u3057\u3044\u30c7\u30fc\u30bf\u304c\u5230\u7740\u3059\u308b\u3068\u3001\u305d\u308c\u3092\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number\"><span class=\"__shape u-col-main\" role=\"presentation\"><\/span><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-m\">\u30af\u30e9\u30a4\u30a2\u30f3\u30c8<\/div><div class=\"swell-block-step__body\">\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306f\u30d7\u30c3\u30b7\u30e5\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d7\u3051\u53d6\u308a\u3001\u901a\u77e5\u30a6\u30a3\u30f3\u30c9\u30a6\u3092\u901a\u3058\u3066\u30e6\u30fc\u30b6\u30fc\u306b\u8868\u793a\u3057\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<p>\u4e0a\u8a18\u306e\u30a2\u30fc\u30ad\u30c6\u30af\u30c1\u30e3\u306e\u3046\u3061\u3001\u30a6\u30a7\u30d6\u901a\u77e5\u6a5f\u80fd\u3092\u8ffd\u52a0\u3059\u308b\u305f\u3081\u306b\u30b5\u30fc\u30d0\u30fc\u3068\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u4e21\u65b9\u306b\u5909\u66f4\u304c\u5fc5\u8981\u3067\u3001\u6b21\u306e\u3088\u3046\u306a\u624b\u9806\u3067\u30a6\u30a7\u30d6\u901a\u77e5\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<div class=\"swell-block-step is-style-small\" style=\"counter-reset:step 4\" data-num-style=\"circle\">\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number\"><span class=\"__shape u-col-main\" role=\"presentation\"><\/span><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-m\">\u30b5\u30fc\u30d0\u30fc\u8a2d\u5b9a<\/div><div class=\"swell-block-step__body\">\n<p>\u30d7\u30c3\u30b7\u30e5\u30b5\u30fc\u30d0\u30fc\u306fSpring Boot\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u57fa\u76e4\u306b\u5b9f\u88c5\u3055\u308c\u3066\u304a\u308a\u3001SSE\u6a5f\u80fd\u3092\u8ffd\u52a0\u3057\u3066EventStream\u5f62\u5f0f\u3067\u30c7\u30fc\u30bf\u3092\u9001\u4fe1\u3057\u307e\u3059\u3002\u3053\u306e\u904e\u7a0b\u3067\u3001\u30b5\u30fc\u30d0\u30fc\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u63a5\u7d9a\u8981\u6c42\u3092\u53d7\u3051\u4ed8\u3051\u3001\u8cfc\u8aad\u3057\u305f\u901a\u77e5\u30c8\u30d4\u30c3\u30af\u3092\u901a\u3058\u3066\u5165\u3063\u3066\u304f\u308b\u30c7\u30fc\u30bf\u3092\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u9001\u4fe1\u3057\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n\n\n\n<div class=\"swell-block-step__item\"><div class=\"swell-block-step__number\"><span class=\"__shape u-col-main\" role=\"presentation\"><\/span><span class=\"__label\">STEP<\/span><\/div><div class=\"swell-block-step__title u-fz-m\">\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u8a2d\u5b9a<\/div><div class=\"swell-block-step__body\">\n<p>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306fNext.js\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306b\u57fa\u3065\u3044\u3066\u5b9f\u88c5\u3055\u308c\u3066\u304a\u308a\u3001EventSource\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3057\u3001\u3053\u308c\u306b\u57fa\u3065\u3044\u3066\u30e6\u30fc\u30b6\u30fc\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u901a\u77e5\u3092\u63d0\u4f9b\u3057\u307e\u3059\u3002<\/p>\n<\/div><\/div>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading u-mb-ctrl u-mb-10 is-style-section_ttl\">\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3068\u4f8b\u984c<\/h2>\n\n\n\n<p>\u305d\u308c\u3067\u306f\u3001\u5b9f\u969b\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u4f8b\u984c\u3092\u4f5c\u3063\u3066\u8aac\u660e\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p><strong><span class=\"swl-fz u-fz-l\">*\u30b5\u30fc\u30d0\u30fc\u8a2d\u5b9a<\/span><\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>import org.springframework.web.bind.annotation.GetMapping;\nimport org.springframework.web.bind.annotation.CrossOrigin;\nimport org.springframework.web.bind.annotation.RestController;\nimport org.springframework.web.bind.annotation.RequestParam;\nimport org.springframework.http.MediaType;\nimport reactor.core.publisher.Flux;\nimport reactor.core.publisher.Sinks;\nimport java.time.Duration;\n\n@RestController\npublic class NotificationController {\n\n    private final Sinks.Many&lt;String&gt; sink = Sinks.many().multicast().onBackpressureBuffer();\n\n    \/\/ \u901a\u77e5\u30a4\u30d9\u30f3\u30c8\u3092\u9001\u308b\n    @CrossOrigin(origins = &quot;&lt;http:\/\/localhost:3000&gt;&quot;)\n    @GetMapping(value = &quot;\/stream&quot;, produces = MediaType.TEXT_EVENT_STREAM_VALUE)\n    public Flux&lt;String&gt; sendNotification() {\n        return sink.asFlux().delayElements(Duration.ofSeconds(1)); \u5404\u30a4\u30d9\u30f3\u30c8\u306e\u9593\u306b1\u79d2\u306e\u9593\u9694\u3092\u8a2d\u5b9a\u3057\u307e\u3059\u3002\n    }\n\n    \/\/ \u901a\u77e5\u767a\u751f\u6642\u306b\u547c\u3073\u51fa\u3055\u308c\u308bAPI\n    @GetMapping(&quot;\/send&quot;)\n    public void triggerEvent(@RequestParam String message) {\n        sink.tryEmitNext(&quot;Received message: &quot; + message);\n    }\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u4e0a\u306e\u4f8b\u984c\u306f<span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">\/stream<\/span><\/span>\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u3067SSE\u30b3\u30cd\u30af\u30b7\u30e7\u30f3\u3092\u3057\u305f\u5f8c\u3001<span class=\"swl-inline-color has-swl-deep-01-color\"><span class=\"swl-bg-color has-swl-gray-background-color\">\/send<\/span><\/span> API\u3067\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3057\u3066\u63a5\u7d9a\u3057\u3066\u3044\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u308b\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u91cd\u8981\u306a\u69cb\u6210\u8981\u7d20\u3067\u3059\u3002<\/p>\n\n\n\n<dl class=\"swell-block-dl is-style-border\">\n<dt class=\"swell-block-dl__dt\">Sinks.Many sink<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p><span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">Sinks.many().multicast().onBackpressureBuffer()<\/span><\/span>\u3092\u4f7f\u3063\u3066\u8907\u6570\u306e\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d0\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u9001\u4fe1\u3067\u304d\u308b<span class=\"swl-inline-color has-swl-deep-01-color\"><span class=\"swl-bg-color has-swl-gray-background-color\">sink<\/span><\/span>\u3092\u751f\u6210\u3057\u307e\u3059\u3002<br>\u3053\u308c\u306b\u3088\u308a\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304b\u3089\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u5bfe\u3057\u3066\u8907\u6570\u306e\u5fdc\u7b54\u3092\u540c\u6642\u306b\u51e6\u7406\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\">stream\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p>\u30fb<span class=\"swl-inline-color has-swl-deep-01-color\"><span class=\"swl-bg-color has-swl-gray-background-color\">@GetMapping<\/span><\/span>\u30a2\u30ce\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u3066\u3001<span class=\"swl-inline-color has-swl-deep-01-color\"><span class=\"swl-bg-color has-swl-gray-background-color\">\/stream<\/span><\/span>\u30d1\u30b9\u3078\u306eGET\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u51e6\u7406\u3057\u307e\u3059\u3002<br><span class=\"swl-inline-color has-swl-deep-01-color\"><span class=\"swl-bg-color has-swl-gray-background-color\">produces = MediaType.TEXT_EVENT_STREAM_VALUE<\/span><\/span>\u306b\u8a2d\u5b9a\u3057\u3066\u3001\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u30c6\u30ad\u30b9\u30c8\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u7d99\u7d9a\u7684\u306b\u9001\u4fe1\u3057\u307e\u3059\u3002<br><br>\u30fb<span class=\"swl-inline-color has-swl-deep-01-color\"><span class=\"swl-bg-color has-swl-gray-background-color\">sink.asFlux().delayElements(Duration.ofSeconds(1))<\/span><\/span>\u3092\u547c\u3073\u51fa\u3057\u3066\u751f\u6210\u3055\u308c\u305f\u30c7\u30fc\u30bf\u30921\u79d2\u9593\u9694\u3067\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306b\u30b9\u30c8\u30ea\u30fc\u30df\u30f3\u30b0\u3057\u307e\u3059\u3002<br><br>\u30fb<span class=\"swl-inline-color has-swl-deep-01-color\"><span class=\"swl-bg-color has-swl-gray-background-color\">@CrossOrigin(origins = &#8220;[http:\/\/localhost:3000](http:\/\/localhost:3000)&#8221;)<\/span><\/span>\uff1a \u30af\u30ed\u30b9\u30aa\u30ea\u30b8\u30f3\u30ea\u30bd\u30fc\u30b9\u306e\u5171\u6709\u3092\u8a31\u53ef\u3057\u3001\u6307\u5b9a\u3055\u308c\u305f\u30aa\u30ea\u30b8\u30f3\u306e\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u30ea\u30bd\u30fc\u30b9\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\">send\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p><span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">\/send<\/span><\/span>\u30d1\u30b9\u304b\u3089\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u53d7\u3051\u53d6\u308a\u3001<span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">sink<\/span><\/span>\u3092\u901a\u3058\u3066\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d0(\u30af\u30e9\u30a4\u30a2\u30f3\u30c8)\u306b&#8221;Received message: +\u30e1\u30c3\u30bb\u30fc\u30b8&#8221;\u5f62\u5f0f\u3067\u9001\u4fe1\u3057\u307e\u3059\u3002\u3053\u308c\u306f\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u901a\u77e5\u3084\u30a4\u30d9\u30f3\u30c8\u3092\u30c8\u30ea\u30ac\u30fc\u3059\u308b\u305f\u3081\u306b\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<\/dd>\n<\/dl>\n\n\n\n<p><strong><span class=\"swl-fz u-fz-l\">*\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u8a2d\u5b9a<\/span><\/strong><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>import { useEffect, useState } from &#39;react&#39;;\n\nexport default function Home() {\n    const [messages, setMessages] = useState([]);\n\n    useEffect(() =&gt; {\n        const eventSource = new EventSource(&#39;&lt;http:\/\/localhost:8080\/stream&gt;&#39;);\n        eventSource.onmessage = function(event) {\n            setMessages(prev =&gt; [...prev, event.data]);\n        };\n\n        return () =&gt; {\n            eventSource.close();\n        };\n    }, []);\n\n    return (\n        &lt;div&gt;\n            &lt;h1&gt;Notifications&lt;\/h1&gt;\n            &lt;ul&gt;\n                {messages.map((msg, index) =&gt; (\n                    &lt;li key={index}&gt;{msg}&lt;\/li&gt;\n                ))}\n            &lt;\/ul&gt;\n        &lt;\/div&gt;\n    );\n}<\/code><\/pre><\/div>\n\n\n\n<p>\u4e0a\u306e\u4f8b\u306f\u3001\u30b5\u30fc\u30d0\u30fc\u306e\u521d\u56de\u63a5\u7d9a\u5f8c\u3001\u7d99\u7d9a\u7684\u306b\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3057\u3066\u753b\u9762\u306b\u63cf\u753b\u3059\u308b\u4f8b\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0b\u306f\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u91cd\u8981\u306a\u69cb\u6210\u8981\u7d20\u3067\u3059\u3002<\/p>\n\n\n\n<dl class=\"swell-block-dl is-style-border\">\n<dt class=\"swell-block-dl__dt\">useState\u3092\u4f7f\u3063\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u72b6\u614b\u7ba1\u7406<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p><span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">useState[]<\/span><\/span>\u3092\u4f7f\u3063\u3066\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u53d7\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30ea\u30b9\u30c8\u3092\u7ba1\u7406\u3057\u307e\u3059\u3002<\/p>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\">useEffect\u3068EventSource<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p>\u30fb<span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">useEffect<\/span><\/span>\u30d5\u30c3\u30af\u5185\u3067<span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">EventSource<\/span><\/span>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u306e<span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">\/stream<\/span><\/span>\u30a8\u30f3\u30c9\u30dd\u30a4\u30f3\u30c8\u306b\u63a5\u7d9a\u3057\u307e\u3059\u3002<br>\u30fb<span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">onmessage<\/span><\/span>\u30cf\u30f3\u30c9\u30e9\u3092\u4f7f\u7528\u3057\u3066\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u53d7\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30b9\u30c6\u30fc\u30bf\u30b9\u306b\u8ffd\u52a0\u3057\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u308a\u3001\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u9001\u4fe1\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u753b\u9762\u306b\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<\/p>\n<\/dd>\n\n\n\n<dt class=\"swell-block-dl__dt\">\u753b\u9762\u51fa\u529b<\/dt>\n\n\n\n<dd class=\"swell-block-dl__dd\">\n<p><span class=\"swl-bg-color has-swl-gray-background-color\"><span class=\"swl-inline-color has-swl-deep-01-color\">messages<\/span><\/span>\u914d\u5217\u3092\u4f7f\u3063\u3066\u53d7\u4fe1\u3057\u305f\u30e1\u30c3\u30bb\u30fc\u30b8\u3092\u30ea\u30b9\u30c8\u5f62\u5f0f\u3067\u753b\u9762\u306b\u51fa\u529b\u3057\u307e\u3059\u3002<\/p>\n<\/dd>\n<\/dl>\n\n\n\n<p><span class=\"swl-fz u-fz-l\" style=\"\">*<b>\u7d50\u679c<\/b><\/span><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"600\" height=\"338\" src=\"https:\/\/edgecross.jp\/blog\/wp-content\/uploads\/2024\/04\/sse03.gif\" alt=\"\" class=\"wp-image-1789\"\/><\/figure>\n\n\n\n<p>\u4f8b\u984c\u3092\u5b9f\u884c\u3055\u305b\u308b\u3068\u3001\u4e0a\u8a18\u306e\u3088\u3046\u306b\u52d5\u4f5c\u3059\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<br>\u6210\u679c\u7269\u3092\u898b\u308b\u3068\u3001\u521d\u56de\u63a5\u7d9a\u6642\u3001\u30cd\u30c3\u30c8\u30ef\u30fc\u30af\u30d5\u30a7\u30f3\u30c7\u30a3\u30f3\u30b0\u304c\u9589\u3058\u3066\u3044\u3066\u3001\u7d42\u4e86\u3057\u306a\u3044\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<br>\u305d\u306e\u5f8c\u3001\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u7d99\u7d9a\u7684\u306b\u30c7\u30fc\u30bf\u3092\u9001\u308b\u3068\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\uff08\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\uff09\u3067\u5225\u9014\u306e\u30ea\u30af\u30a8\u30b9\u30c8\u306a\u3057\u3067\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u30c7\u30fc\u30bf\u3092\u53d7\u4fe1\u3059\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u672c\u4f8b\u3067\u306f\u3001API\u3092\u901a\u3058\u3066\u76f4\u63a5\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u751f\u3055\u305b\u3066\u307f\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3092MQTT\u30d6\u30ed\u30fc\u30ab\u30fc\u3092\u901a\u3058\u3066\u7279\u5b9a\u306e\u30c8\u30d4\u30c3\u30af\u3092\u30b5\u30d6\u30b9\u30af\u30e9\u30a4\u30d6\u3057\u305f\u308a\u3001\u5b9a\u671f\u7684\u306a\u30d0\u30c3\u30c1\u4f5c\u696d\u3092\u901a\u3058\u3066\u7279\u5b9a\u306e\u6642\u9593\u3054\u3068\u306b\u30a4\u30d9\u30f3\u30c8\u3092\u767a\u751f\u3055\u305b\u308b\u65b9\u6cd5\u3067\u5fdc\u7528\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br>\u3053\u306e\u3088\u3046\u306b\u3001\u305d\u308c\u305e\u308c\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u8981\u4ef6\u306b\u5408\u308f\u305b\u3066\u5e45\u5e83\u304f\u9069\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4ee5\u4e0a\u3001EdgeCross\u3067\u306f\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0Web\u30d6\u30e9\u30a6\u30b6\u901a\u77e5\u3092\u5b9f\u88c5\u3059\u308b\u65b9\u6cd5\u306e\u4e00\u3064\u3067\u3042\u308bServer-Sent Events(SSE)\u6280\u8853\u3092\u4e2d\u5fc3\u306b\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<br>SSE\u306f\u3001\u30e6\u30fc\u30b6\u30fc\u30a8\u30af\u30b9\u30da\u30ea\u30a8\u30f3\u30b9\u3092\u5411\u4e0a\u3055\u305b\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30c7\u30fc\u30bf\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u306e\u52b9\u7387\u3092\u9ad8\u3081\u308b\u306e\u306b\u5927\u304d\u306a\u30e1\u30ea\u30c3\u30c8\u304c\u3042\u308a\u307e\u3059\u3002<br>\u8907\u96d1\u306a\u8a2d\u5b9a\u3092\u3057\u306a\u304f\u3066\u3082\u3001Web\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u30b5\u30fc\u30d0\u30fc\u304b\u3089\u306e\u30c7\u30fc\u30bf\u30b9\u30c8\u30ea\u30fc\u30e0\u3092\u7c21\u5358\u306b\u5b9f\u88c5\u3067\u304d\u308b\u305f\u3081\u3001\u7279\u306b\u52d5\u7684\u306a\u30c7\u30fc\u30bf\u51e6\u7406\u304c\u5fc5\u8981\u306a\u5834\u5408\u306b\u9069\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u79c1\u305f\u3061\u304c\u63d0\u4f9b\u3057\u305f\u5b9f\u88c5\u4e8b\u4f8b\u3068\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u304c\u3042\u306a\u305f\u306e\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306b\u6709\u7528\u306a\u30a4\u30f3\u30b5\u30a4\u30c8\u3092\u63d0\u4f9b\u3057\u3001SSE\u3092\u6d3b\u7528\u3057\u305f\u591a\u69d8\u306a\u65b9\u6cd5\u3092\u6a21\u7d22\u3059\u308b\u306e\u306b\u5f79\u7acb\u3064\u3053\u3068\u3092\u9858\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p>EdgeCross\u516c\u5f0f\u30db\u30fc\u30e0\u30da\u30fc\u30b8\u306f\u3053\u3061\u3089<\/p>\n\n\n\n<div class=\"swell-block-button red_ -size-custom is-style-btn_line\" style=\"--the-fz:1em;--the-icon-size:1em;--the-width:100%\" data-align=\"left\"><a href=\"https:\/\/edgecross.ai\/jp\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"swell-block-button__link\" data-has-icon=\"1\"><svg class=\"__icon\" height=\"1em\" width=\"1em\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" aria-hidden=\"true\" viewBox=\"0 0 48 48\"><path d=\"M21.2 30.2c-.5 0-1-.2-1.4-.6l-.7-.7c-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l7.1-7.1c2.3-2.3 5.3-3.5 8.5-3.5s6.2 1.2 8.5 3.5c4.7 4.7 4.7 12.3 0 17l-3.5 3.5c-.8.8-2 .8-2.8 0-.8-.8-.8-2 0-2.8l3.5-3.5c3.1-3.1 3.1-8.2 0-11.3-1.5-1.5-3.5-2.3-5.7-2.3-2.1 0-4.2.8-5.7 2.3l-7.1 7.1c-1.5 1.5-2.3 3.5-2.3 5.7s.8 4.2 2.3 5.7l.7.7c.8.8.8 2 0 2.8-.4.3-.9.5-1.4.5z\"><\/path><path d=\"M13.4 46.6c-3.1 0-6.1-1.2-8.5-3.5-2.3-2.3-3.5-5.3-3.5-8.5s1.2-6.2 3.5-8.5l3.5-3.5c.8-.8 2-.8 2.8 0 .8.8.8 2 0 2.8l-3.5 3.5c-1.5 1.5-2.3 3.5-2.3 5.7 0 2.1.8 4.2 2.3 5.7 3.1 3.1 8.2 3.1 11.3 0l7.1-7.1c1.5-1.5 2.3-3.5 2.3-5.7 0-2.1-.8-4.2-2.3-5.7l-.7-.7c-.8-.8-.8-2 0-2.8.8-.8 2-.8 2.8 0l.7.7c2.3 2.3 3.5 5.3 3.5 8.5s-1.2 6.2-3.5 8.5l-7.1 7.1c-2.3 2.3-5.3 3.5-8.4 3.5z\"><\/path><\/svg><span>EdgeCross \u516c\u5f0f\u30db\u30fc\u30e0\u30da\u30fc\u30b8<\/span><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u73fe\u5834\u3067\u30b9\u30de\u30fc\u30c8\u30de\u30b7\u30f3\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3\u3092\u5c0e\u5165\u3059\u308b\u969b\u3001\u6700\u3082\u6e80\u8db3\u5ea6\u304c\u9ad8\u3044\u6a5f\u80fd\u306e\u4e00\u3064\u304c\u3001\u7570\u5e38\u72b6\u6cc1\u304c\u767a\u751f\u3057\u305f\u969b\u306b\u8fc5\u901f\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u3067\u901a\u77e5\u3059\u308b\u3053\u3068\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306f\u3001EdgeCross\u304c\u6a5f\u68b0\u30e2\u30cb\u30bf\u30ea\u30f3\u30b0\u30fb\u9060\u9694\u5236\u5fa1\u30bd\u30ea\u30e5\u30fc\u30b7\u30e7\u30f3 Machine Manager(PROGIX, SCAUTR)\u3067\u3001\u3069\u306e\u3088\u3046\u306b\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u901a\u77e5\u6a5f\u80fd\u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b\u306e\u304b\u3054\u7d39\u4ecb\u3057\u307e\u3059\u3002OTA\uff08Over The Air\uff09\u6280\u8853\u306f\u3001\u7121\u7dda\u901a\u4fe1\u3092\u5229\u7528\u3057\u3066\u30ea\u30e2\u30fc\u30c8\u3067\u30c7\u30d0\u30a4\u30b9\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u66f4\u65b0\u3059\u308b\u6280\u8853\u3067\u3059\u3002<br \/>\n\u3053\u306e\u6280\u8853\u306b\u3088\u308a\u3001\u5de5\u5834\u7ba1\u7406\u8005\u3084\u6a5f\u68b0\u30e1\u30fc\u30ab\u30fc\u306f\u3001\u9060\u9694\u5730\u304b\u3089\u6a5f\u68b0\u306e\u30bd\u30d5\u30c8\u30a6\u30a7\u30a2\u3092\u66f4\u65b0\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3057\u305f\u3002EdgeCross\u306e\u3088\u3046\u306a\u5148\u9032\u7684\u306a\u30c7\u30d0\u30a4\u30b9\u304cLTE\u3092\u6d3b\u7528\u3059\u308b\u3053\u3068\u3067\u3001\u696d\u754c\u306b\u304a\u3051\u308b\u30c7\u30fc\u30bf\u53ce\u96c6\u3068\u5206\u6790\u306e\u65b0\u305f\u306a\u5730\u5e73\u304c\u958b\u304b\u308c\u3066\u3044\u307e\u3059\u3002\u6280\u8853\u306e\u9032\u5316\u306b\u4f34\u3044\u3001LTE\u3092\u542b\u3080\u7121\u7dda\u901a\u4fe1\u6280\u8853\u306e\u53ef\u80fd\u6027\u306f\u3055\u3089\u306b\u5e83\u304c\u3063\u3066\u3044\u304f\u3053\u3068\u3067\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"author":1,"featured_media":1799,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"swell_btn_cv_data":"","footnotes":""},"categories":[11,203],"tags":[149,148,147,146,145,63,70,64,83,68,34,26,71],"class_list":["post-1772","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tech","category-inside-aiot","tag-149","tag-148","tag-websocket","tag-146","tag-sse","tag-ai","tag-http","tag-iot","tag-machine-manager","tag-mqtt","tag-progix","tag-scautr","tag-71"],"acf":[],"_links":{"self":[{"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/posts\/1772","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/comments?post=1772"}],"version-history":[{"count":14,"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/posts\/1772\/revisions"}],"predecessor-version":[{"id":1798,"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/posts\/1772\/revisions\/1798"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/media\/1799"}],"wp:attachment":[{"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/media?parent=1772"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/categories?post=1772"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/edgecross.jp\/blog\/wp-json\/wp\/v2\/tags?post=1772"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}