{"id":31321,"date":"2025-11-25T05:22:03","date_gmt":"2025-11-25T05:22:03","guid":{"rendered":"https:\/\/www.dotcom-monitor.com\/blog\/what-is-a-websocket\/"},"modified":"2026-07-16T02:02:28","modified_gmt":"2026-07-16T02:02:28","slug":"what-is-a-websocket","status":"publish","type":"post","link":"https:\/\/www.dotcom-monitor.com\/blog\/ja\/what-is-a-websocket\/","title":{"rendered":"WebSocket\u3068\u306f\uff1f\u30d7\u30ed\u30c8\u30b3\u30eb\u3001API\u3001\u304a\u3088\u3073\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u63a5\u7d9a\u306e\u89e3\u8aac"},"content":{"rendered":"

\"WebSocket\u3068\u306f\uff1f\u30d7\u30ed\u30c8\u30b3\u30eb\u3001API\u3001\u304a\u3088\u3073\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u63a5\u7d9a\u306e\u89e3\u8aac\"<\/p>\n

WebSocket\u3068\u306f\uff1f<\/h2>\n

WebSocket<\/b>\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\uff08\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\u306a\u3069\uff09\u3068\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u30b5\u30fc\u30d0\u30fc\u9593\u3067\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u53cc\u65b9\u5411\u901a\u4fe1<\/b>\u3092\u53ef\u80fd\u306b\u3059\u308b\u6700\u65b0\u306e\u30a6\u30a7\u30d6\u901a\u4fe1\u30d7\u30ed\u30c8\u30b3\u30eb\u3067\u3042\u308a\u3001\u3059\u3079\u3066\u5358\u4e00\u306e\u6301\u7d9a\u7684\u306aTCP\u63a5\u7d9a<\/b>\u3092\u901a\u3058\u3066\u884c\u308f\u308c\u307e\u3059\u3002<\/p>\n

\u5f93\u6765\u306eHTTP<\/b>\u306f\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u304c\u30b5\u30fc\u30d0\u30fc\u306b\u7e70\u308a\u8fd4\u3057\u66f4\u65b0\u3092\u8981\u6c42\u3059\u308b\u30ea\u30af\u30a8\u30b9\u30c8-\u30ec\u30b9\u30dd\u30f3\u30b9\u30e2\u30c7\u30eb<\/b>\u306b\u4f9d\u5b58\u3057\u3066\u3044\u308b\u306e\u306b\u5bfe\u3057\u3001WebSocket\u306f\u7d99\u7d9a\u7684\u306a\u63a5\u7d9a\u3092\u78ba\u7acb\u3057\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u30b5\u30fc\u30d0\u30fc\u306e\u53cc\u65b9\u304c\u3044\u3064\u3067\u3082\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u9001\u53d7\u4fe1\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059<\/b>\u3002\u3053\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u306e\u30c7\u30fc\u30bf\u4ea4\u63db\u306b\u3088\u308a\u3001\u30dd\u30fc\u30ea\u30f3\u30b0\u3084\u30da\u30fc\u30b8\u306e\u66f4\u65b0\u306b\u3088\u308b\u9045\u5ef6\u304c\u6392\u9664\u3055\u308c\u307e\u3059\u3002<\/p>\n

\u52b9\u7387\u6027\u3068\u5fdc\u7b54\u6027\u306e\u9ad8\u3055\u304b\u3089\u3001WebSocket\u306f\u30e9\u30a4\u30d6\u30c1\u30e3\u30c3\u30c8\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3001\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u30c0\u30c3\u30b7\u30e5\u30dc\u30fc\u30c9\u3001\u30de\u30eb\u30c1\u30d7\u30ec\u30a4\u30e4\u30fc\u30b2\u30fc\u30e0\u3001\u30b3\u30e9\u30dc\u30ec\u30fc\u30b7\u30e7\u30f3\u30c4\u30fc\u30eb\u3001\u682a\u5f0f\u5e02\u5834\u30d5\u30a3\u30fc\u30c9<\/b>\u306a\u3069\u3001\u77ac\u6642\u306e\u66f4\u65b0\u3068\u52d5\u7684\u306a\u30e6\u30fc\u30b6\u30fc\u4f53\u9a13\u3092\u5fc5\u8981\u3068\u3059\u308b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306b\u6700\u9069\u3067\u3059\u3002<\/p>\n

\u901a\u4fe1\u30c1\u30e3\u30cd\u30eb\u3092\u958b\u3044\u305f\u307e\u307e\u306b\u3059\u308b\u3053\u3068\u3067\u3001WebSocket\u306f\u30b7\u30fc\u30e0\u30ec\u30b9\u3067\u30a4\u30d9\u30f3\u30c8\u99c6\u52d5\u306e\u30a4\u30f3\u30bf\u30e9\u30af\u30b7\u30e7\u30f3<\/strong>\u3092\u5b9f\u73fe\u3057\u3001\u9ad8\u901f\u3067\u9b45\u529b\u7684\u3001\u304b\u3064\u9ad8\u5ea6\u306b\u30a4\u30f3\u30bf\u30e9\u30af\u30c6\u30a3\u30d6\u306a\u30a6\u30a7\u30d6\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u69cb\u7bc9<\/strong>\u3092\u52a9\u3051\u307e\u3059\u3002\u7279\u306b\u3001\u63a5\u7d9a\u306e\u5065\u5168\u6027\u3001\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u6d41\u308c\u3001\u30d0\u30c3\u30af\u30a8\u30f3\u30c9\u306e\u4f9d\u5b58\u95a2\u4fc2\u306e\u53ef\u8996\u5316\u3092\u63d0\u4f9b\u3059\u308b\u5f37\u529b\u306aAPI\u30aa\u30d6\u30b6\u30fc\u30d0\u30d3\u30ea\u30c6\u30a3\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0<\/a>\u3068\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u52b9\u679c\u7684\u3067\u3059\u3002<\/p>\n

WebSocket\u306e\u4ed5\u7d44\u307f<\/h2>\n

\u63a5\u7d9a\u306e\u78ba\u7acb<\/h3>\n

WebSocket\u63a5\u7d9a<\/b>\u306f\u3001\u30cf\u30f3\u30c9\u30b7\u30a7\u30a4\u30af<\/b>\u3068\u547c\u3070\u308c\u308b\u30d7\u30ed\u30bb\u30b9\u304b\u3089\u59cb\u307e\u308a\u307e\u3059\u3002\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\uff08\u901a\u5e38\u306f\u30a6\u30a7\u30d6\u30d6\u30e9\u30a6\u30b6\uff09\u306f\u3001Upgrade\u30d8\u30c3\u30c0\u30fc\u3092”websocket”\u306b\u8a2d\u5b9a\u3057\u305fHTTP\u30ea\u30af\u30a8\u30b9\u30c8<\/b>\u3092\u30b5\u30fc\u30d0\u30fc\u306b\u9001\u308a\u307e\u3059\u3002\u3053\u308c\u306f\u6a19\u6e96\u306eHTTP\u30d7\u30ed\u30c8\u30b3\u30eb\u304b\u3089WebSocket\u30d7\u30ed\u30c8\u30b3\u30eb<\/b>\u3078\u306e\u5207\u308a\u66ff\u3048\u3092\u793a\u3057\u307e\u3059\u3002<\/p>\n

\u30ea\u30af\u30a8\u30b9\u30c8\u306b\u306fConnection: Upgrade<\/b>\u30d8\u30c3\u30c0\u30fc\u3082\u542b\u307e\u308c\u3001\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002\u30b5\u30fc\u30d0\u30fc\u304cWebSocket\u3092\u30b5\u30dd\u30fc\u30c8\u3057\u3066\u3044\u308b\u5834\u5408\u3001101 Switching Protocols<\/b>\u30b9\u30c6\u30fc\u30bf\u30b9\u30b3\u30fc\u30c9\u3068Upgrade: websocket<\/b>\u30d8\u30c3\u30c0\u30fc\u3067\u5fdc\u7b54\u3057\u307e\u3059\u3002\u3053\u306e\u30cf\u30f3\u30c9\u30b7\u30a7\u30a4\u30af\u304c\u5b8c\u4e86\u3059\u308b\u3068\u3001\u63a5\u7d9a\u306fHTTP\u304b\u3089WebSocket\u3078\u3068\u6b63\u5e38\u306b\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3055\u308c\u3001\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u30b5\u30fc\u30d0\u30fc\u9593\u306b\u6301\u7d9a\u7684\u306a\u5168\u4e8c\u91cd\u901a\u4fe1\u30c1\u30e3\u30cd\u30eb<\/b>\u304c\u4f5c\u6210\u3055\u308c\u307e\u3059\u3002<\/p>\n

\u5168\u4e8c\u91cd\u901a\u4fe1<\/h3>\n

\u63a5\u7d9a\u78ba\u7acb\u5f8c\u3001WebSocket\u306f\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3068\u30b5\u30fc\u30d0\u30fc\u9593\u306e\u30ea\u30a2\u30eb\u30bf\u30a4\u30e0\u53cc\u65b9\u5411\u30c7\u30fc\u30bf\u8ee2\u9001\u3092\u53ef\u80fd\u306b\u3057\u307e\u3059<\/b>\u3002\u5f93\u6765\u306eHTTP\u306e\u3088\u3046\u306a\u30ea\u30af\u30a8\u30b9\u30c8\u3068\u30ec\u30b9\u30dd\u30f3\u30b9\u306e\u901a\u4fe1\u3068\u306f\u7570\u306a\u308a\u3001WebSocket\u306f\u4e21\u8005\u304c\u540c\u6642\u306b\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u9001\u53d7\u4fe1\u3092\u884c\u3048\u307e\u3059<\/b>\u3002<\/p>\n

\u3053\u306e\u53cc\u65b9\u5411\u901a\u4fe1<\/b>\u306f\u3001\u3069\u3061\u3089\u304b\u304c\u63a5\u7d9a\u3092\u9589\u3058\u308b\u307e\u3067\u7dad\u6301\u3055\u308c\u307e\u3059\u3002\u3055\u3089\u306b\u3001WebSocket\u306f\u30b5\u30d6\u30d7\u30ed\u30c8\u30b3\u30eb<\/b>\u3092\u4f7f\u7528\u3067\u304d\u3001\u3053\u308c\u306f\u30b3\u30a2\u306eWebSocket\u30d7\u30ed\u30c8\u30b3\u30eb\u306e\u4e0a\u306b\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u56fa\u6709\u306e\u901a\u4fe1\u30eb\u30fc\u30eb\u3092\u5b9a\u7fa9\u3057\u3001\u8907\u96d1\u306a\u30c7\u30fc\u30bf\u30d5\u30ed\u30fc\u3084\u7279\u6b8a\u306a\u30e1\u30c3\u30bb\u30fc\u30b8\u5f62\u5f0f\u306e\u51e6\u7406\u3092\u5bb9\u6613\u306b\u3057\u307e\u3059\u3002<\/p>\n

\u30e1\u30c3\u30bb\u30fc\u30b8\u306e\u30d5\u30ec\u30fc\u30df\u30f3\u30b0<\/h3>\n

WebSocket\u901a\u4fe1\u306f\u30e1\u30c3\u30bb\u30fc\u30b8\u30d5\u30ec\u30fc\u30df\u30f3\u30b0<\/b>\u306b\u3088\u3063\u3066\u69cb\u6210\u3055\u308c\u3001\u30c7\u30fc\u30bf\u304c\u52b9\u7387\u7684\u304b\u3064\u4fe1\u983c\u6027\u9ad8\u304f\u9001\u4fe1\u3055\u308c\u308b\u3053\u3068\u3092\u4fdd\u8a3c\u3057\u307e\u3059\u3002\u5404WebSocket\u30e1\u30c3\u30bb\u30fc\u30b8\u306f\u4ee5\u4e0b\u3067\u69cb\u6210\u3055\u308c\u307e\u3059\uff1a<\/p>\n