James Coglan
0034f5fe19
Fail the connection when the server receives an invalid Sec-WebSocket-Extensions header.
2015-03-26 08:51:34 +00:00
James Coglan
8a0235ef51
Don't send a close frame in response to receiving one, if we already sent a close frame.
2015-03-12 12:58:43 +00:00
James Coglan
ebe4ce1382
Because Driver.frame() will now admit input when in readyState 2 (to allow for async extension shutdown), the Messages stream should use the text() and binary() methods that will block messages in that state.
2015-02-16 09:51:40 +00:00
James Coglan
7e34e7fd40
Correct the name of the test about proxy 'connect' events.
2014-11-08 16:43:36 +00:00
James Coglan
0bb47c17b4
Remove TLS concerns from the proxy implementation.
...
This results in a more simple design, in the sense of fewer concerns
being mixed together. It makes the API more verbose, but it's not
difficult to use correctly.
It also means that we make the I/O implementation deal with TLS, so it
can use tls.connect({socket: io}) or the upcoming TLSSocket class,
rather than this module needing a huge amount of boilerplate and
internal indirection to use tls.createSecurePair() and make Proxy wrap
pair.encrypted.
Using tls.connect({socket: io}) would be awkward on this end, because it
expects a stream that emits *incoming* data from the TCP connection. All
the streams in this module emit *outgoing* data that should be written
to TCP, so their polarity is flipped compared to what tls.connect()
wants, and resolving that involves even more stream boilerplate.
2014-11-08 15:20:08 +00:00
James Coglan
4348bec390
Some cleanup to remove bits I left lying around while refactoring proxy support.
2014-11-06 23:04:11 +00:00
James Coglan
550b3d906d
Unify the proxy handshake, TLS handshake, and WebSocket protocol into a single stream when using driver.proxy() to simplify the API.
2014-11-05 23:30:15 +00:00
David Glasser
b88b8d6856
proxy should emit 'close' when it's done
...
This will cause any stream piped into it to stop piping into it. (It's
the only way to unpipe a Node 0.8 Streams1-style pipe.)
This change allows you to remove the empty "stream.on('data')" in
faye-websocket.
2014-10-29 16:47:56 -07:00
James Coglan
76f4128634
Redesign the proxy API so that we can more cleanly deal with TLS, either to the proxy server or origin server or both, while still allowing control of the TLS options and custom headers, and not leaking so much of the implementation.
2014-10-29 22:07:01 +00:00
James Coglan
bdc9bfe7e8
Add support for connecting via HTTP proxies.
2014-10-27 09:30:11 +00:00
David Glasser
dcd7c278b6
driver.close() before driver.start() should close
2014-08-15 10:48:30 -07:00
James Coglan
dfe7b2b000
Trailing blank lines are bad.
2014-05-17 00:35:31 +01:00
James Coglan
9f2782da14
Correct the draft-76 status line reason phrase.
2014-04-17 02:23:58 +01:00
David Glasser
f15b331a34
Reduce frame max length to max Node Buffer length.
2013-10-11 19:21:14 -07:00
James Coglan
12f9f4d444
Add support for Basic Auth URLs to the client driver.
2013-08-13 17:16:49 +01:00
James Coglan
c5b3df986b
Migrate to jstest.
2013-07-01 02:10:29 +01:00
James Coglan
1124df2bf5
Add a Server driver for running WebSockets through a bare TCP server.
2013-05-12 01:13:50 +01:00
James Coglan
ea4e289669
Add a setHeader() function to allow peers to add headers to their handshake responses.
2013-05-11 22:26:20 +01:00
James Coglan
d7c65eedd9
Expose the status and headers from the response in the client driver.
2013-05-11 21:58:37 +01:00
James Coglan
25c075a408
Rename the module to websocket-driver.
2013-05-04 16:42:44 +01:00
James Coglan
f16ad50db0
Raise an error if the length header is larger than the max int that JS can represent precisely.
2013-05-04 13:33:27 +01:00
James Coglan
d716650499
Add more robust error handling for Hybi and Client and emit error events when the protocol goes wrong.
2013-05-02 00:09:14 +01:00
James Coglan
103c39c664
Correct the name of a test suite.
2013-05-01 02:11:32 +01:00
James Coglan
23f296b926
Replace the getVersion() method with a version property.
2013-05-01 00:55:49 +01:00
James Coglan
f6481422b9
Firm up the event system. Make handlers only emit their own events, and then map those to Messages and IO events with a bit of glue. Only emit 'data' when streams are readable, same for 'end'.
2013-04-30 23:35:51 +01:00
James Coglan
9975aa089b
Use the Node EventEmitter class to publish events.
2013-04-30 08:20:14 +01:00
James Coglan
b354dd69fa
Implement the draft-76 protocol.
2013-04-29 20:27:35 +01:00
James Coglan
e3b8033c58
Placeholder for draft-76 support just to get the common tests passing.
2013-04-29 08:56:05 +01:00
James Coglan
950cd9f1e2
Implement and test draft-75.
2013-04-29 08:40:05 +01:00
James Coglan
6f7942d5b7
Begin writing the draft75 module.
2013-04-29 07:48:09 +01:00
James Coglan
41ddd82932
Add tests for Hybi and Client handlers and fix some minor bugs.
2013-04-28 23:22:05 +01:00
James Coglan
847bdc1773
Strip the repo down to just the protocol handlers.
2013-04-28 19:04:03 +01:00
James Coglan
62a0c7597f
First steps toward streaming I/O-independent parsing. Implement the Hybi and Client protocol handlers as stateful protcol drivers with two duplex streams, one for messages and one for I/O.
2013-04-28 18:55:58 +01:00
James Coglan
78f8bfb26b
Remove parser specs.
2013-04-28 14:01:28 +01:00
James Coglan
ee22f75959
Remove trailing whitespace.
2012-12-22 23:13:04 +00:00
James Coglan
7b63baa5a6
Fix specs on v0.9.
2012-12-22 23:12:08 +00:00
James Coglan
680d8fc759
Remove an expensive test.
2012-05-21 19:37:40 +01:00
James Coglan
3675cfb798
Treat anything but a Buffer as a text message in WebSocket#send.
2012-02-25 09:49:53 +00:00
James Coglan
8c9ae84740
Treat numbers as strings when passed to Socket.send().
2012-02-16 23:09:29 +00:00
James Coglan
bdb0de2cfa
Draft-75/76 frames with length headers should be ignored.
2011-12-20 19:44:07 +00:00
James Coglan
6704d33859
Implement the full framing interpreter for draft-75/76, including closing frames for 76.
2011-12-19 22:59:08 +00:00
James Coglan
4240b6bc27
Test that parsers are not sensitive to how data is split across packets.
2011-12-19 21:36:49 +00:00
James Coglan
2782990fe3
Rename Protocol8Parser to HybiParser.
2011-12-19 21:25:19 +00:00
James Coglan
fa2aff1387
Implement client-side subprotocol validation, and expose the protocol property.
2011-12-18 15:57:24 +00:00
James Coglan
d295047393
Decouple TCP sockets from parsers.
2011-12-17 01:41:34 +00:00
James Coglan
b5a3de9112
Use addEventListener in the tests.
2011-11-29 21:01:27 +00:00
James Coglan
c14b0df6b5
Test client for TLS connections.
2011-11-26 19:00:30 +00:00
James Coglan
8299ff6ab0
Extract WebSocket classes from Faye 0.7.
2011-11-24 02:07:55 +00:00