Skip to content

x/net/websocket: add a web socket client when targeting js/wasm #27311

Open
@definitelycarter

Description

@definitelycarter

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

v 1.11

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN="/Users/adamtcarter/go/bin"
GOCACHE="/Users/adamtcarter/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/adamtcarter/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/7h/f4ryg4z10xd13dy_qf221grc0000gn/T/go-build718587663=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Use web sockets in go while targeting js,wasm

What did you expect to see?

NA

What did you see instead?

NA

If it makes sense, please add a WebSocket client in x/net/websocket when targeting js,wasm. I was digging around some of the code and it looks like it would be possible by taking a similar approach to what was taken with http.Request calling the native browser fetch api. Let me know if it's viable and I can take a stab at it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureRequestIssues asking for a new feature that does not need a proposal.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.OS-JS

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions