James Coglan
50ca31b4c8
Remove empty Driver#shutdown method.
2015-07-07 20:40:53 +01:00
James Coglan
9523937428
Initialize StreamReader in the base constructor.
2015-07-07 20:38:26 +01:00
Samuel Williams
425e15da83
Use StreamReader for both hybi and draft75.
2015-07-06 10:29:18 +09:00
James Coglan
fa11841bfa
Don't catch errors from event listeners. Instead, make sure that in all parsing methods in Hybi, @stage is set before any user called is invoked so the parser is in the right state before code that might raise is called.
2015-07-05 18:52:53 +01:00
James Coglan
83d317add2
Rescue from Exception when calling event listeners, and use the name 'error' for caught exceptions.
2015-07-05 15:31:36 +01:00
James Coglan
8eccf044b0
Change stage in the Base.shutdown() method to that all parsers stop processing input.
2015-07-04 21:06:50 +01:00
James Coglan
f218999304
If an event listener emits an error, close the connection with code 1011.
2015-07-04 20:54:42 +01:00
James Coglan
7af53b5be0
Add a pong() command for sending unsolicited pong frames.
2015-07-04 18:49:46 +01:00
James Coglan
d6b147f2e0
Fail the connection when the server receives an invalid Sec-WebSocket-Extensions header.
2015-03-26 09:43:59 +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
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
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
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
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
74c4cc1190
Extend max-length checking to draft-{75,76}.
2013-12-20 10:27:48 +00: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
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
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