WebSocket sends Connection: "close" instead of "upgrade" on HTTPS
See original GitHub issueWhat kind of issue is this?
-
Question. This issue tracker is not the place for questions. If you want to ask how to do something, or to understand why something isn’t working the way you expect it to, use Stack Overflow. https://stackoverflow.com/questions/tagged/okhttp
-
Bug report. If you’ve found a bug, spend the time to write a failing test. Bugs with tests get fixed. Here’s an example: https://gist.github.com/swankjesse/981fcae102f513eb13ed
-
Feature Request. Start by telling us what problem you’re trying to solve. Often a solution already exists! Don’t send pull requests to implement new features without first getting our support. Sometimes we leave features out on purpose to keep the project small.
I’m using OKHTTP 3.9.1 and WebSocket always fails on https. So I printed the packet on server, and seems that for https
, connection
is close
instead of upgrade
. Same code runs well on http
server (actually my https
is under nginx
it’s the same service on different ports). I noticed that there’s some “https upgrade problem” mentioned in okhttp-3.9.1 release notes, but not sure about the details. Any configuration needs to be done or anything please?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
It looks like misconfigured Ngnix. Make sure your
location
entry explicitly setsUpgrade
andConnection
headers. Both values can be either static or dynamic depending on requirements.See this article https://www.nginx.com/blog/websocket-nginx/ and documentation https://nginx.org/en/docs/http/websocket.html for more info.
According to pasted headers you’re using OkHttp 3.8.0
On Mon, Feb 5, 2018, 9:37 PM Leo notifications@github.com wrote:
Great! Don’t forget to update OkHttp 😃