aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun_socks.erl
AgeCommit message (Collapse)Author
2023-01-23Update copyright lines in preparation for releaseLoïc Hoguin
2022-10-24Handle send errorsViktor Söderqvist
2022-08-30Make Protocol:init/4 return an ok-tupleViktor Söderqvist
This is a preparation for allowing init/4 to return an ok or an error tuple.
2020-11-12Return 'undefined' for raw|socks origin_scheme where applicableLoïc Hoguin
2020-11-12Update copyright yearsLoïc Hoguin
2020-10-21Fix cookie handling when tunnel and origin schemes mismatchLoïc Hoguin
The cookie_ignore_informational has been moved to http_opts and http2_opts. Also fix an issue when using 'protocols' in gun:open. When connecting via TLS the protocol's options were discarded.
2020-10-03Add tunnel_SUITE testing all 3-layer combinationsLoïc Hoguin
The test suite is 216 tests with a tunnel created via two proxies leading to one origin server. The tests are for example socks5_h2_https where socks5 identifies the first SOCKS5 proxy, h2 the second HTTP/2 CONNECT proxy and https the secure HTTP/1.1 origin server. The test not only sets up the tunnel and does a request (or sends/receives data in the case of raw origin servers) but also confirms that the stream_info and info data is correct.
2020-09-21Add a gun:stream_ref() type and fix DialyzerLoïc Hoguin
2020-09-21Refactor protocol handling via gun_protocolsLoïc Hoguin
2020-09-21Replace gun_tunnel_up/3 message with /4 variantLoïc Hoguin
Also fixes all the tests. Lots of work remain around protocols (how best to pass the base stream_ref to them? maybe the current solution, maybe a new argument to Protocol:init) and strengthen the concept of stream_ref, at least with its own type.
2019-09-26Add reply_to option to ws_upgrade; remove notowner entirelyLoïc Hoguin
The reply_to option is also propagated when we switch protocols.
2019-09-24Initial support for raw send/recv operationsLoïc Hoguin
Gun can now be used to send or receive arbitrary data in the following scenarios: * Directly after connecting to a server (this is not terribly useful but it works nevertheless due to the Gun architecture) * After connecting through one or more Socks and/or HTTP proxies. This allows using Gun's proxy capabilities to access servers located beyond firewalls. * After performing an HTTP/1.1 Upgrade. This allows using Gun to implement custom protocols that require upgrading from an HTTP/1.1 connection. As there is still no support for HTTP/2 CONNECT for the time being, there are no relevant streams attached to those use cases and therefore the raw protocol currently expects users to use 'undefined' as the StreamRef value. This is not a final decision and will most likely produce a Dialyzer warning at this time.
2019-09-23Use the proper options type for socks/ws statesLoïc Hoguin
2019-09-22Rework state transitions resulting from from protocol changesLoïc Hoguin
2019-09-22Supports going through multiple Socks proxiesLoïc Hoguin
This commit also reworks the switch_protocol command. The `P | {P, Opts}` type is used here as well. This allows us to remove the code specific to Websocket. In addition a few new protocol functions allow us to declare what's the name of the options key for the protocol and what the capabilities are with regard to keepalive.
2019-09-22Support connecting to HTTPS server via TCP Socks5Loïc Hoguin
2019-09-22Add test for username_password authLoïc Hoguin
2019-09-22Initial support for Socks5Loïc Hoguin