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

parseURL() breaks custom Proxy #290

Closed
canning-duck opened this issue Oct 10, 2017 · 1 comment
Closed

parseURL() breaks custom Proxy #290

canning-duck opened this issue Oct 10, 2017 · 1 comment

Comments

@canning-duck
Copy link
Contributor

really this is #147, but we're using a custom Proxy and the behavior of parseURL() breaks our code as we pass URL's String() to the function that actually searches for the proxy (Java's URI()/ ProxySelector.Select(), we're running on Android using gomobile)

To restate the issue: the connection URL is "wss://example.com/im/connect?foo=bar".

  • parseURL() returns &url.URL{Scheme:"wss", Opaque:"/im/connect", Host:"example.com", RawQuery:"foo=bar"} that resolves to "wss:/im/connect?foo=bar" when calling String(). The problem is that the host is missing.
  • net/url.Parse() would return &url.URL{Scheme:"wss", Host:"example.com", Path:"/im/connect", RawQuery:"foo=bar"} that resolves to "wss://example.com/im/connect?foo=bar" as expected (go 1.9).
@garyburd
Copy link
Contributor

The parse function works around a bug in Go 1.4 and earlier. See https://go.googlesource.com/go/+/874a605af0764a8f340c3de65406963f514e21bc for the detals.

It's OK to drop support for Go 1.4. I will accept a PR that replaces parseURL() with url.Parse().

canning-duck added a commit to canning-duck/websocket that referenced this issue Oct 11, 2017
@gorilla gorilla locked and limited conversation to collaborators Feb 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants