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

Confirming this library runs in the browser ? #103

Open
ordinaryorange opened this issue Feb 9, 2018 · 3 comments
Open

Confirming this library runs in the browser ? #103

ordinaryorange opened this issue Feb 9, 2018 · 3 comments

Comments

@ordinaryorange
Copy link

I've tried to run the client in chrome to connect to Azure cosmos without luck.
Upon inspection via fiddler, the connection does not seem to be promoting to a websocket.
I see all tests are node and all examples I can find online are node based.

Is browser possible as per the opening remarks of readme ?

@philosaur
Copy link

I am very curious about this as well.

@dbugsy
Copy link

dbugsy commented Feb 15, 2018

Having a similar problem - had a look at the requests and got the following:

GET /gremlin HTTP/1.1
Host: localhost:8182
Connection: keep-alive
Pragma: no-cache
Cache-Control: no-cache
Origin: http://localhost:8080
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36
Accept: */*
Referer: http://localhost:8080/
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9

This led to a response of 'not a WebSocket handshake request: missing upgrade'.

I tested another websocket connection, which made a successful connection to the same gremlin server, and the request looked like this:

GET /gremlin HTTP/1.1
Host: localhost:8182
Connection: Upgrade
Pragma: no-cache
Cache-Control: no-cache
Upgrade: websocket
Origin: file://
Sec-WebSocket-Version: 13
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Sec-WebSocket-Key: lEslnVBk32uXrH45/G8rSA==
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits

It looks like this is the same problem - I have been unable to get this library to send a ws connection over the browser.

@jbmusso
Copy link
Owner

jbmusso commented Apr 5, 2018

It used to work in the browser in earlier version, about 3 years ago, but I couldn't confirm today (the README is misleading, I confess). I think it shouldn't be too hard to tweak the code to make it work in browsers. The size of the bundle could be an issue though since I never really tried to do optimization there.
Any of you willing to have a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants