James Coglan
95c0261505
Don't emit further error/close events if the driver is already closing.
2015-02-16 09:08:18 +00:00
James Coglan
7b4352bb2f
Throw an error if drivers are created with unrecognised options.
2014-12-17 22:09:58 +00:00
James Coglan
b99ab25583
Fix some string/array discrepancies in the hixie-{75,76} drivers.
2014-12-13 13:34:11 +00:00
James Coglan
9bc3b9b3f6
Mistakenly used bytesize on an array.
2014-12-06 10:38:03 +00:00
James Coglan
01c1a762e0
Don't expose the frame structure of messages, only expose their opcode and RSV headers. Extensions will mess with frame boundaries so depending on frame structure won't work.
2014-12-05 23:07:47 +00:00
James Coglan
ef862fd341
Serialise the FIN and RSV bits of frames correctly.
2014-12-05 19:27:39 +00:00
James Coglan
eb20069011
Migrate the internal representation of buffers from arrays to ASCII-8BIT strings, since this is what we're planning on handing off to extensions.
2014-12-05 09:17:09 +00:00
James Coglan
ef4fc7c57a
Migrate the Hybi driver's internals to use Frame and Message objects compatible with websocket-extensions.
2014-12-02 22:51:42 +00:00
James Coglan
1a9f2af571
Use the Headers class to build the default headers for handshakes rather than using loads of ugly string operations.
2014-11-08 17:44:34 +00:00
James Coglan
ec6803e19c
Remove the start_tls protocol and replace it by the proxy emitting a 'connect' event.
2014-11-08 16:45:06 +00:00
James Coglan
0a200bbdef
Refactor proxy support into a separate class that represents the proxy connection as a real object.
2014-11-06 23:37:13 +00:00
James Coglan
8392f77a58
Add support for connecting via HTTP proxies.
2014-10-27 21:49:40 +00:00
James Coglan
58c19e7659
If driver.close is called before driver.start, the driver should close.
2014-10-03 00:36:50 +01:00
Asmod4n
c04bfc4c19
fail_request didn't accept a required argument
2014-09-21 00:57:24 +02:00
James Coglan
129a238613
Fix ping/pong issue where Server#ping fails to pass the callback on to the Hybi driver.
2014-07-19 16:48:32 +01:00
James Coglan
a403ca4c8d
Simplify the subprotocol selection code.
2014-07-04 20:50:08 +01:00
James Coglan
4b4d69e946
Delegate the protocol and version methods correctly in the TCP driver.
2014-07-04 09:42:26 +01:00
James Coglan
d00cbadedb
Stop the Hybi parser hanging onto data it doesn't need after emitFrame().
2014-06-16 20:45:48 +01:00
James Coglan
7c755523f1
Include RFC 7230 grammar notes.
2014-06-07 22:23:39 +01:00
James Coglan
1b3f32bbc7
Trailing blank lines are bad.
2014-05-17 00:34:48 +01:00
James Coglan
03ca89f4a0
Remove a duplicated request-method check from WebSocket.websocket?.
2014-05-09 00:31:31 +01:00
James Coglan
f55f2b221c
Header names must not contain backslashes. Include grammer from RFC2616 to clarify this.
2014-05-09 00:30:28 +01:00
James Coglan
23c8e8eb91
The file that loads the C code is not executable and does not need a shebang.
2014-04-17 02:29:56 +01:00
James Coglan
2f8f281615
Correct the draft-76 status line reason phrase.
2014-04-17 02:22:19 +01:00
James Coglan
ddd90b5438
Tweak the regexes for parsing HTTP.
2014-04-17 02:19:14 +01:00
Steven Williamson
08189c2a30
Minor fixes to allow native gems to load.
...
- websocket_mask.rb is in lib which in turn then loads websocket_mask.so
which should reside in the extensions directory external to the gem
directory at least as of rubygems 2.2.2.
- Changed extensions directory to match gemname as suggested in rubygems
guide
Simplifies loading the native extension but only tested on ruby 2.1.1
and only in my environment.
2014-04-14 17:18:54 +01:00
James Coglan
13780f7a61
Reduce MAX_LENGTH to 64 MB.
2013-12-27 18:19:09 +00:00
James Coglan
18170c0c61
Stop parsing Hybi once we go into a failure state.
2013-12-27 18:13:31 +00:00
James Coglan
74c4cc1190
Extend max-length checking to draft-{75,76}.
2013-12-20 10:27:48 +00:00
James Coglan
fafd949641
Extend max-length checking to short (<= 125 bytes) frames and to sequences of continuation frames.
2013-12-20 10:23:53 +00:00
James Coglan
e3587fcbb1
Add a max_length option to the Hybi/Client class.
2013-12-02 21:55:43 +00:00
James Coglan
eae69314f1
Add support for Basic Auth URLs to the client driver.
2013-09-09 20:28:29 +01:00
James Coglan
46af51d04e
Dup the listener list during EventEmitter#emit so that events unregistered during this call don't cause others to be skipped.
2013-08-04 13:57:08 +01:00
James Coglan
cd53761699
Fix EventEmitter#listener_count in the case where the event type does not exist, and add EventEmitter#listners.
2013-08-04 12:11:37 +01:00
James Coglan
ac3bb51cbd
Adjust encoding operations so that encoding is explicit at the call site, and all strings written to I/O are ASCII-8BIT.
2013-07-02 09:46:29 +01:00
James Coglan
ee5fe9ec5f
Messages should be queued when the client is in the 'pre-connecting' state, as the client is initially.
2013-06-06 10:25:10 +01:00
James Coglan
ae84f0eaf7
Headers#inspect should call @raw.inspect.
2013-05-12 15:12:44 +01:00
James Coglan
8cd6ff1dde
Set status and headers as soon as they are known, so they are available in case of an error.
2013-05-12 14:49:59 +01:00
James Coglan
be00c65ebd
Make Headers#inspect do something useful.
2013-05-12 14:01:15 +01:00
James Coglan
cfd2806683
Remove an unneeded instance variable.
2013-05-12 12:41:51 +01:00
James Coglan
3902b8bc4f
Around here we use square brackets for arrays.
2013-05-11 23:03:17 +01:00
James Coglan
074a8a2f16
Add #status and #headers methods to the Client driver.
2013-05-11 20:42:06 +01:00
James Coglan
5a7fadbcbe
Add API for setting custom handshake headers.
2013-05-11 20:28:36 +01:00
James Coglan
020c094e96
Add a driver for handling TCP servers, where we don't want to make the user parse the HTTP request.
2013-05-11 19:28:59 +01:00
James Coglan
ba696e8e2c
Implement a proper streaming HTTP response parser. This makes the client-side parser more robust and also gives a way to building a driver for TCP servers.
2013-05-11 16:56:29 +01:00
James Coglan
93dd655d6d
Implement EventEmitter#on as a method that calls #add_listener instead of being an alias, so that overriding the latter affects the former.
2013-05-04 18:02:40 +01:00
James Coglan
c9388b7627
Add a listener_count method to EventEmitter.
2013-05-04 18:00:17 +01:00
James Coglan
c5526b1c09
Return false from websocket? unless the request method is GET.
2013-05-04 17:46:35 +01:00
James Coglan
be1f1cdc35
Rename the module to websocket-driver.
2013-05-04 16:43:25 +01:00
James Coglan
9a28b3f90d
Various bits of housekeeping.
2013-05-03 09:04:14 +01:00