Closed dmill-bz closed 8 years ago
Changed the styling a bit. Should be a better match for babel.
Thanks for sending this Dylan. Unfortunately, FileReader
is a browser API and doesn't work in a Node.js environment. I pushed a branch (see https://github.com/jbmusso/gremlin-javascript/commit/852574f9da2ac352935d867df45a6688b81a81f5?diff=split) where I converted your code to use Buffer.toString()
(Buffer
is a core Node.js module). I believe Buffer
is shimmed when using browserify (I think via https://github.com/feross/buffer). Hopefully this should work in all environments (browsers/Node.js).
Can you checkout this and see if that works in a browser when using browserify?
Ah good I didn't realize that!. I'll close this and test it out.
This should correct the issue with the client not communicating the
mimeType
to the server.What the PR covers:
WebSocketGremlinConnection
now sends messages asbinary
andmasked
GremlinClient
now packs the request messages in binary with the includedmimeType
headersGremlinClient
now unpacks the binary Blob response sent back from the serverI wasn't able to get
npm run test:node
to work, got some strange legacy node error ; I think my env isn't setup correctly. So this will need testing as I only have some manual testing going for this PR at the moment.FYI, my manual testing covers:
application/json
simple send and reading response (haven't tried any streaming)application/gremlinbin
same as above