Skip to content

Support WASM #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ os:

language: go
go:
- 1.10.x
- 1.11.x

install:
- make deps
Expand Down
28 changes: 28 additions & 0 deletions impl_wasm.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package reuseport

import (
"context"
"net"
)

// TODO. for now, just pass it over to net.Listen/net.Dial

func listen(network, address string) (net.Listener, error) {
return net.Listen(network, address)
}

func listenPacket(netw, laddr string) (net.PacketConn, error) {
return net.ListenPacket(netw, laddr)
}

func listenStream(netw, addr string) (net.Listener, error) {
return listen(netw, addr)
}

func dial(ctx context.Context, dialer net.Dialer, network, address string) (net.Conn, error) {
return dialer.DialContext(ctx, network, address)
}

func available() bool {
return false
}