Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

wasm: Close with codes other than 1000 throws, so CloseNow never closes

オープン
#575 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@0pcom がすでに取り組んでいます。

2026年10月4日 から。

  • #576 @0pcom による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
20/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
停滞
技術スタック
go
領域
networking

調査の方向性

The issue describes the failure in the js/wasm build when Conn.Close passes unsupported codes to the browser's WebSocket.close, and links PR #576, which is already open. Read that pull request and the Close/CloseNow path it changes; the issue's expected behavior is that rejected codes are sent as 1000 so the browser closes the socket without an error or panic.

索引モデルが issue の本文から書いたものです。

説明

In the js/wasm build, Conn.Close passes the code straight to the browser's WebSocket.close, which only accepts 1000 and 3000-4999 and throws InvalidAccessError for anything else. This package closes with 1001 (CloseNow), 1008 (read or dial context done), 1009 (read limit) and 1011 (write error), so all of those return an error and leave the socket open. Under TinyGo the throw is not recovered, so the program panics.

To reproduce, dial any server and call c.CloseNow(). In Chromium it returns:

failed to close WebSocket: JavaScript error: Failed to execute 'close' on 'WebSocket': The close code must be either 1000, or between 3000 and 4999. 1001 is neither.

A fix is to send 1000 to the browser for the codes it rejects. I have a PR for it.

主要言語
Go
スター
5.5k
フォーク
379
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

coder/websocket のほかの issue

coder/websocket の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。