経緯 WebSocketを使ったアプリケーションを作ったが、ポートが80しか使えない nginxでどっちも80に流したい ポイント / はまり所 WebSocketのプロキシにはUpgradeヘッダ(HTTP 1.1)への対応が必要 Upgradeヘッダへの対応は nginx v1.3.13以降 参考: WebSocket proxying 厳しい条件から先に書く デフォルトだと30秒通信がないと切断される(!) nginxでリバースプロキシしているときだけ一定時間で接続が切れるので何かと思えば、 普通のHTTPの通信と同様に30秒(だったはず)通信がなかった場合はタイムアウトってことで自動でコネクションを切ってくれていたみたい。 ping/pongを30s以内にやればいいんだろうけど、とりあえず5分に設定。 config server { listen *:80 default_serv
The WebSocket protocol provides a way of creating web applications that support real‑time bidirectional communication between clients and servers. Part of HTML5, WebSocket makes it much easier to develop these types of applications than the methods previously available. Most modern browsers support WebSocket including Chrome, Firefox, Internet Explorer, Opera, and Safari, and more and more server
/** * Module dependencies. */ var express = require('express') , routes = require('./routes') , user = require('./routes/user') , http = require('http') , path = require('path'); var app = express(); app.configure(function(){ app.set('port', process.env.PORT || 3000); app.set('views', __dirname + '/views'); app.set('view engine', 'ejs'); app.use(express.favicon()); app.use(express.logger('dev'));
websocket-sharp A C# implementation of the WebSocket protocol client and server View on GitHub Download .zip Download .tar.gz Welcome to websocket-sharp! websocket-sharp supports: RFC 6455 WebSocket Client and Server Per-message Compression extension Secure Connection HTTP Authentication Query String, Origin header and Cookies Connecting through the HTTP Proxy server .NET Framework 3.5 or later (i
Internet Engineering Task Force (IETF) I. Fette Request for Comments: 6455 Google, Inc. Category: Standards Track A. Melnikov ISSN: 2070-1721 Isode Ltd. December 2011 The WebSocket Protocol Abstract The WebSocket Protocol enables two-way communication between a client running untrusted code in a controlled environment to a remote host that has opted-in to communications from that code. The securit
When I wrote about the HiveMQ MQTT broker I said it had a killer-feature: support for Websockets. I’ll admit to have been pestering Roger Light, creator of Mosquitto, so much that to shut me up (I think) he’s been adding support for Websockets into the Mosquitto broker! This makes using MQTT even more fun. Websocket support must be explicitly enabled when building Mosquitto, and building requires
WebSocketsの接続状態には、CONNECTING / OPEN / CLOSING / CLOSEDのステートが定められている。 一方、CLOSING状態への遷移に対応するイベントは存在せず、CLOSE状態へ遷移した際にcloseイベントが発生するとされている。 つまり、「closeイベントが来るまでは送信できるぜー」ってなコードを書いてると、正常系なのにsend()で例外発生する可能性がある。 なので、面倒だけど、 if (ws.readyState == 1) { ws.send(...); }のようなガードを入れる必要がある*1。もしくは、ws.readyState == CLOSING 状態になったらcloseイベントのハンドラを呼び出すようなラッパーを書く必要がある。 と、以上の結論に至ったんですが、あってますでしょうか? >識者 以下、規格からの引用。 CONNECTI
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く