You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. Have the AutobahnPython WAMP server running
(http://github.com/tavendo/AutobahnPython, examples/wamp/rpc/simple/example1/server.py)
1. import "code.google.com/p/go.net/websocket"
2. client, err := websocket.Dial("ws://localhost:9000/", "wamp",
"http://localhost:8080";)
3. if err != nil { file bug report }
What is the expected output?
It should work. In the initial request headers, there should be a line
"Sec-WebSocket-Protocol: wamp".
What do you see instead?
1. The protocol is not set on the Config object.
2. No such header is sent.
3. The AutobahnPython server responds with "HTTP/1.1 400 this server only speaks
WAMP".
4. Dial abort with ErrBadStatus.
Which compiler are you using (5g, 6g, 8g, gccgo)?
Irrelevant. (But "go". Why does it ask this like this? Aren't 5g, 6g and 8g
obsoleted by "go"?)
Which operating system are you using?
Irrelevant. (But Ubuntu 12.04 64-bit.)
Which version are you using? (run 'go version')
Irrelevant. It's in code.google.com/p/go.net/websocket that the problem is. (But it's
go1.)
Please provide any additional information below.
In the package "code.google.com/p/go.net/websocket", the function Dial (in
client.go) has three arguments: (url_, protocol, string). However, that protocol
argument isn't used.
I believe it's meant to map to the websocket subprotocol as represented in
Config.Protocol, i.e. config.Protocol = []string{protocol}.
In the mean time, I can't use Dial; I have to instead do just what it does, with setting
config.Protocol in the midst of it:
config, err := websocket.NewConfig(url, origin)
if err != nil {
return nil, err
}
config.Protocol = []string{"wamp"}
ws, err := websocket.DialConfig(config)
Incidentally, given the compiler's admirable objection to unused variables, I'm mildly
surprised it doesn't complain of unused function parameters (though to be sure there
would need to be a way of suppressing such errors, but _ could be used).
The text was updated successfully, but these errors were encountered:
by chris.morganiser:
The text was updated successfully, but these errors were encountered: