Skip to content
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

x/net/websocket: can't connect to WS server on ARM (raspberry pi), test passes #5812

Closed
gopherbot opened this issue Jun 29, 2013 · 7 comments
Closed
Milestone

Comments

@gopherbot
Copy link

@gopherbot gopherbot commented Jun 29, 2013

by fh@cbix.de:

I wrote a small HTML5 chat you can find under
https://github.com/ProjectU2672/recyclingDepot/tree/7d5edc76955115b9fffcb4204c1a2a31a7ed2329
,  backed by go and your websocket package. It works perfectly on my amd64 machine, but
if I open http://raspberry-host:12345, the chat won't connect over websocket, while the
actual HTTP connection works. go test code.google.com/p/go.net/websocket passes in 0.5
sec.

What steps will reproduce the problem?
1. on a Raspberry Pi running arch linux ARM and the latest go version, run git clone
https://github.com/ProjectU2672/recyclingDepot.git && cd recyclingDepot
&& git checkout 7d5edc7
2. go run wsecho.go
3. point your browser to the Pi on port 12345

What is the expected output?
A chat connecting over websocket

What do you see instead?
A chat failing to connect over websocket

Which compiler are you using (5g, 6g, 8g, gccgo)?
5g

Which operating system are you using?
Arch Linux ARM

Which version are you using?  (run 'go version')
go version go1.1.1 linux/arm

Please provide any additional information below.
On the raspberry pi "go test code.google.com/p/go.net/websocket" passes in 0.5
sec.
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Jun 29, 2013

Comment 1 by fh@cbix.de:

Did I mention that no error messages are shown in the console? Additionally
http://raspberry-host:12345/echo outputs "not websocket protocol", which means the
actual websocket handler works.
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Jun 29, 2013

Comment 2 by fh@cbix.de:

# go test net
--- FAIL: TestInterfaceArrivalAndDeparture (0.02 seconds)
    interface_unix_test.go:113: testInterface.setup failed: exit status 2
FAIL
FAIL    net 198.707s
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Jun 29, 2013

Comment 3 by capnm9:

You have a garbage in your js code:
var ws = new WebSocket(location.href.replace(/^http/, "ws").replace(/\/*$/, "/echo"))//,
["proto1", "proto2"]);
I would recommend, first ask such questions in the ML.
https://groups.google.com/forum/#!forum/golang-nuts
@gopherbot
Copy link
Author

@gopherbot gopherbot commented Jun 29, 2013

Comment 4 by fh@cbix.de:

Wow, thanks, but then I wonder why the exact same thing works when run on my amd64
localhost...
@davecheney
Copy link
Contributor

@davecheney davecheney commented Jun 30, 2013

Comment 5:

The error handling in that sample is all messed up. There are several cases where the
error is handled, then execution continues with incorrect data.
I suggest that the reason behaviour differs between your arm and amd64 hosts is related
to the different networking configuration.
I'd like to suggest that you move this discussion to the mailing list. If a bug is
discovered then we can open a new issue for it when a better test case is available.

Status changed to WaitingForReply.

@gopherbot
Copy link
Author

@gopherbot gopherbot commented Jun 30, 2013

Comment 6 by capnm9:

@#4 In short, for multiple protocols you must implement a handshake function. It isn't
possible that it works otherwise (except your amd64 Go installation is broken or your
browser for some reason isn't sending a protocol request to the localhost).
@rsc
Copy link
Contributor

@rsc rsc commented Jul 30, 2013

Comment 7:

Status changed to Invalid.

@mikioh mikioh changed the title websocket: can't connect to WS server on ARM (raspberry pi), test passes x/net/websocket: can't connect to WS server on ARM (raspberry pi), test passes Jul 30, 2015
@mikioh mikioh modified the milestone: Unreleased Jul 30, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.