小林 (koichik) さん、
森(mori_dev) です。
HTTPだと、途中のProxyなどによってはUpgrade: が通らない可能性があるため、
HTTPを推奨しているのかもしれない。だから、xhr-polling で使う場合、WebSocket への
Upgrade: 処理は行わないのだし、HTTP でよさそうだとのこと。
わかりました。ありがとうございました。
私の方でさらに調べたところ、 RFC6455 WebSocket (
http://tools.ietf.org/html/rfc6455 )
に、ハンドシェイク時の仕様で、以下のような関係がありそうな記述をみつけたのですが、
4.2.2. Sending the Server's Opening Handshake
When a client establishes a WebSocket connection to a server, the
server MUST complete the following steps to accept the connection and
send the server's opening handshake.
1. If the connection is happening on an HTTPS (HTTP-over-TLS) port,
perform a TLS handshake over the connection. If this fails
(e.g., the client indicated a host name in the extended client
hello "server_name" extension that the server does not host),
then close the connection; otherwise, all further communication
for the connection (including the server's handshake) MUST run
through the encrypted tunnel [RFC5246].
"otherwise, all further communicatio for the connection (including the server's handshake) MUST run
through the encrypted tunnel [RFC5246]." だと何か困るのか?だから HTTPS 推奨なのか、
といったところまではたどり着きませんでした。
socket-spec を書いた人が HTTPS を推奨する理由を説明している資料を見つけたら、
この ML で報告しようと思います。
ありがとうございました。