Skip to content

Support building for WASM #213

Description

@flimzy

At present, this package fails to build for WASM:

../../../../go/pkg/mod/golang.stackrox.io/grpc-http1@v0.3.13-0.20240812074332-70d8a3e22717/client/ws_proxy.go:235:3: unknown field HTTPHeader in struct literal of type websocket.DialOptions
../../../../go/pkg/mod/golang.stackrox.io/grpc-http1@v0.3.13-0.20240812074332-70d8a3e22717/client/ws_proxy.go:236:3: unknown field HTTPClient in struct literal of type websocket.DialOptions
../../../../go/pkg/mod/golang.stackrox.io/grpc-http1@v0.3.13-0.20240812074332-70d8a3e22717/client/ws_proxy.go:239:3: unknown field CompressionMode in struct literal of type websocket.DialOptions

This is due to the fact that github.com/coder/websocket exposes different DialOptions structs for WASM than for other targets. There is an issue open that would address at least some of this, but it's old and hasn't gotten much attention.

Unless/until github.com/coder/websocket addresses this issue, is it reasonable for go-grpc-http1 to put the DialOptions use behind a build tag, so that it can compile for web assembly?

I'm happy to submit a pull request if it's likely to be accepted.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions