-
Notifications
You must be signed in to change notification settings - Fork 138
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
Websocket never receives any messages #2855
Comments
Can you try with http instead, with the same parameters, and see if there are any errors? |
That does not work, as 'http' is not part of the scheme for websockets, code throws an exception that uri is invalid. Weird enough it establishes connection, as can be seen from logs, but immediately closes it. |
No I just meant to try to query the It might be easier to diagnose. |
Here's a link to the Sync Gateway REST api: https://developer.couchbase.com/documentation/mobile/current/references/sync-gateway/rest-api/index.html |
I've looked at that, as well as |
So everything worked fine w/ the non-websocket changes feed? |
I can hit it with Postman, and I get results back, yes. |
@snej does anything jump out at you about this websocket usage? |
This works from same console app, I get changes
but this part does not, it throws Bad Request error.
|
I don't see anything, but I've never used that client API. |
I'm not surprised. There are other parameters you'd have to add, to make that a valid WebSocket connect request. Have you tried packet-sniffing with Charles or WireShark or something like that? |
@snej: No I have not. I am just following documentation, and these were the options that were mentioned. |
@snej:
So what I get in console as output is : Open, Sent Options, Closed. |
Looking at our client code, we send the initial options message as binary not text. Try doing that. |
@snej: Wooohooo, you're the man. It worked. I probably should write up a doc for .Net users
|
Sync Gateway version
{"couchdb":"Welcome","vendor":{"name":"Couchbase Sync Gateway","version":1.4},"version":"Couchbase Sync Gateway/1.4.0(2;9e18d3e)"}
Operating system
The operating system you're running Sync Gateway on.
Windows 10
Config file
Log output
https://gist.github.com/epitka/fa9c3d07f4bc34e8eb0117c5203b4e2b
Expected behavior
What should have happened?
Should receive changes
Actual behavior
What actually happened?
Websocket closes immediately after being open
Steps to reproduce
Console app code that connects to web socket is following (.Net and WebSocketSharp library)
Interesting thing to note is that in OnOpen handler, if ws.IsAlive is false.
The text was updated successfully, but these errors were encountered: