Closed
Description
I just ran into an issue using the latest versions of github.com/gopherjs/gopherjs
and github.com/gopherjs/websocket
wihch seems to be caused by websocket
pulling in the stdlib net
package. net
has a global variable var listenerBacklog = maxListenerBacklog()
in net/net.go
which gets initialized during package initialization. In the browser at runtime this initialization causes a call to os.Open("/proc/sys/net/core/somaxconn")
which triggers the following error on the JS console:
warning: system calls not available, see https://github.com/gopherjs/gopherjs/blob/master/doc/syscalls.md
The solution that worked for me was to add the following stub to github.com/gopherjs/gopherjs/compiler/natives/net/net.go
:
func maxListenerBacklog() int {
return 0x80
}
where 0x80
is the value of syscall.SOMAXCONN
for Linux. I'm using Go 1.4.1 on linux_amd64.
Metadata
Metadata
Assignees
Labels
No labels