260 Commits

Author SHA1 Message Date
HoneyryderChuck
377da998a7 compression: added custom transcoders for gzip and deflate; extending response to mask the buffer with an equally streamable decoder, after the response is fully buffered; request now adds accept-encoding automatically 2017-12-22 13:18:31 +02:00
HoneyryderChuck
b480249d0b added more compression tests, specially one to test the accept-encoding headers 2017-12-22 13:16:49 +02:00
HoneyryderChuck
dab9965f87 options: dup now dups some of the values as well, particularly the ones which keep the reference (and cause class conflicts) 2017-12-22 13:15:37 +02:00
HoneyryderChuck
957fc46bcf response: do not alias #write to #<<, makes it hard to extend; #each now yields predictable-size chunks, instead of deferring to buffer#each, which can do whatever 2017-12-22 13:14:33 +02:00
HoneyryderChuck
b55911277a added compression plugin and tests (for now, failing) 2017-12-22 10:10:46 +02:00
HoneyryderChuck
6667055e05 ::IO for the top class 2017-12-22 09:55:30 +02:00
HoneyryderChuck
fc57bc2837 registry: passing along registers to subclasses 2017-12-22 09:55:07 +02:00
HoneyryderChuck
3807688c61 added IO module to register IO types; now one needs to explicitly call ::IO for top-level 2017-12-22 09:54:35 +02:00
HoneyryderChuck
08f018c248 fixed proxy script 2017-12-22 09:53:11 +02:00
HoneyryderChuck
695ea6e8a8 http1: fixed bug, where callbacks were referring to the wrong request; as a mental note, outgoing requests go to the end of the line; incoming response always refers to the first request in line, because HTTP/1 is a FIFO 2017-12-22 09:52:52 +02:00
HoneyryderChuck
ef7fe6d0b2 registering the channel outside of build method; response callback is now a proper method, instead of a proc 2017-12-22 09:37:40 +02:00
HoneyryderChuck
f2498190a8 proxy test script 2017-12-22 09:18:32 +02:00
HoneyryderChuck
128b5fc97e allowing to extend http2 channel for proxies; simplified proxy argument (uri instead of proxy_uri) 2017-12-22 09:18:12 +02:00
HoneyryderChuck
6f2d4c1540 added supported for authenticated proxy requests (didn't test it yet, though) 2017-12-21 17:09:28 +02:00
HoneyryderChuck
eac3955892 comment about the site for ssl proxies 2017-12-21 17:08:54 +02:00
HoneyryderChuck
da97b19161 proxyssl: resetting the ip and port, as the main class will try to eager load it (which is in itself already bad, because it's at least one dns request, and might fail if not possible to query, which is what usually happens behind a proxy) 2017-12-21 17:02:45 +02:00
HoneyryderChuck
14d32ef52a proxy: added support to HTTP_PROXY and family; for this, one is binding the proxy channel late in the game, based on the request uris 2017-12-21 17:01:28 +02:00
HoneyryderChuck
c0189c46e6 closing parser in transition call 2017-12-21 16:24:36 +02:00
HoneyryderChuck
f9d6ad0fd0 requests: improved headline granularity; removed some proxy request header logic 2017-12-21 16:24:24 +02:00
HoneyryderChuck
44acebf424 proxy channel is now a state machine 2017-12-21 16:12:43 +02:00
HoneyryderChuck
359a74437a removed unused variables 2017-12-21 16:06:38 +02:00
HoneyryderChuck
d68abd5fbc proxy: better naming for modules 2017-12-21 15:36:43 +02:00
HoneyryderChuck
acf0641e0e moving ProxySSL to plugin 2017-12-21 15:36:19 +02:00
HoneyryderChuck
af3a81b7a2 proxy: added multiple possible proxies to choose (for now it's a static list, but these might become unavailable, added dynamic fetching later) 2017-12-21 15:35:58 +02:00
HoneyryderChuck
48d8714225 added support for https proxy connect flow; removed the proxy server tests, as I found a list of public proxies, which are good enough to test around; added a bit more logging 2017-12-21 15:21:58 +02:00
HoneyryderChuck
48e55a7ca2 removing :proxy options from base class, adding them with the plugin 2017-12-20 19:14:19 +02:00
HoneyryderChuck
9729fa0d82 ::IO for the top class 2017-12-20 19:13:48 +02:00
HoneyryderChuck
defe140466 proxy: http-proxying is now possible; on connection, a proxy channel is initialized, which should match against ALL requests, so this means that, by passing a proxy, one is saying that ALL requests on that client are proxied; a lot of object monkey-patching takes place, but this should be alright, as these objects should be long-lived in the grand scheme of things (if there will only be one channel, there will also be only one parser, etc etc) 2017-12-20 19:00:21 +02:00
HoneyryderChuck
36ce3851d1 parser: isolating some logic, so that it can be more easily overridden; these have to make sense, obviously 2017-12-20 18:57:50 +02:00
HoneyryderChuck
7b98053cf2 space 2017-12-20 18:56:50 +02:00
HoneyryderChuck
f375a9bbb9 registry: passing along registers to subclasses 2017-12-20 18:56:29 +02:00
HoneyryderChuck
6d7c3d73b6 testing on /get 2017-12-20 18:56:12 +02:00
HoneyryderChuck
cd784e43d0 added first draft of proxy plugin: connection gets extended; proxy creates a proxy channel, which initializes with a separate parser and an initial connect request; it's still failing, though 2017-12-20 17:29:01 +02:00
HoneyryderChuck
01d41b076e channel: register happens separately 2017-12-20 17:27:30 +02:00
HoneyryderChuck
9ee00921f8 added proxy tests; the tests use local nghttpx as proxy, which means this'll become a dependency 2017-12-20 17:26:57 +02:00
HoneyryderChuck
eb173e0217 added IO module to register IO types; now one needs to explicitly call ::IO for top-level 2017-12-20 12:11:01 +02:00
HoneyryderChuck
c96e5b0a50 refactored the redirect module; allow to pass an already initialized body to the request 2017-12-19 15:37:54 +02:00
HoneyryderChuck
d044458031 added redirection functionality, along with capping the number of redirections (default: 3), after which it returns the last known response 2017-12-19 15:37:54 +02:00
HoneyryderChuck
460c1346d2 added test for following redirects, added plugin scaffold, test fails, of course 2017-12-19 15:37:53 +02:00
HoneyryderChuck
a47ba100f5 capping max timeout to 30 seconds 2017-12-19 14:20:14 +02:00
HoneyryderChuck
87f949894b fixed header initialization (specifically in the case when it is initialized with two set-cookie incoming fields) 2017-12-19 13:07:05 +02:00
HoneyryderChuck
193828527b added debug_level option, which can make logs more verbose 2017-12-19 13:06:51 +02:00
HoneyryderChuck
0f42c368c7 Get first, head later 2017-12-19 13:06:24 +02:00
HoneyryderChuck
45bd2a11c7 fixing the leakage of altered resource classes to the main default options 2017-12-19 13:06:09 +02:00
HoneyryderChuck
0c307c82c3 removing the cookies test from options 2017-12-19 13:05:54 +02:00
HoneyryderChuck
a179fe7aa0 http-cookie is now a dev dep 2017-12-19 13:05:34 +02:00
HoneyryderChuck
48b6faa2c3 options: removing the cookies stuff by default there 2017-12-19 13:05:21 +02:00
HoneyryderChuck
3c72a20d46 removing usage of ** params, as this forces typecast to hash, and one loses the options silently keeping the object passed in init, which is a big part of the plugins 2017-12-19 13:05:07 +02:00
HoneyryderChuck
a5a48c8d83 fixed header initialization (specifically in the case when it is initialized with two set-cookie incoming fields) 2017-12-19 13:00:27 +02:00
HoneyryderChuck
aec527be33 added debug_level option, which can make logs more verbose 2017-12-19 12:59:52 +02:00