Chrome 19 error after getting response: "A server must not mask any frames that it sends to the client."
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- php
- 領域
- networking
調査の方向性
websocket.class.php とその encode 関数から始め、次に php server.php を実行して、issue に記載されている Chrome 19 の接続およびエコーのフローを再現します。サーバーからクライアントへのフレーム処理を、参照されている hybi10Encode 実装と比較します。Chrome がサーバーフレームがマスクされていると報告せずにエコーバックされたメッセージを受け入れれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Chrome 19 stops connection after receiving message from server with: "A server
must not mask any frames that it sends to the client."
What steps will reproduce the problem?
First you have to fix chrome so it doesn't disconnect imediatly apon connecting
by replacing this line:
preg_match ("#Sec-WebSocket-Origin: (.*?)\r\n#", $buffer, $match) && $origin =
$match[1];
with
preg_match ("#Origin: (.*?)\r\n#", $buffer, $match) && $origin = $match[1];
Then connect to the server with:
php server.php
Then refresh the chrome browser. Firefox 12 works fine.
Send a message to in the chrome 19 browser. It will get to the server and be
send back.
This error appears in chrome console.
"A server must not mask any frames that it sends to the client."
I spent a few hours researching the problem and found the solution.
The encode function is the problem.
I couldn't figure out how to not mask the data being sent to the server until I
found a github example that works and has a flag you can set to not mask the
data frames.
https://github.com/lemmingzshadow/php-websocket
I replaced the encode function in websocket.class.php with the one in the
connection.php file in lemmingzshadow's github and it started working. The
function is called: hybi10Encode in the \server\lib\WebSocket\connection.php
file.
change this parameter in the function encode: $masked = true to $masked = false
I am using windows 7 64bit with php 5.4.1
Also there is an updated version of this that might be of use to someone:
http://www.wilky.it/phpwebsocket-new-version/
Original issue reported on code.google.com by [email protected] on 30 Jun 2012 at 6:00
- 主要言語
- PHP
- スター
- 0
- フォーク
- 0
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
et-nik/phpwebsocket のほかの issue
-
auto-migrated Priority-Medium Type-Defect
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
et-nik/phpwebsocket#77 ·
-
auto-migrated Priority-Medium Type-Defect
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
et-nik/phpwebsocket#78 ·
-
auto-migrated Type-Patch
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
et-nik/phpwebsocket#72 ·
-
auto-migrated Type-Patch
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
et-nik/phpwebsocket#73 ·
-
auto-migrated Type-Patch
難易度 5/5 1週間以上 初心者へのやさしさ 10/100
et-nik/phpwebsocket#74 ·
et-nik/phpwebsocket の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
-
Made by AI module: MCP type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
maintenance
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
hawk-digital-environments/HAWKI#443 ·
メンテナーはふだん 1 日以内に返信