aboutsummaryrefslogtreecommitdiffstats
path: root/src/gun.erl
AgeCommit message (Collapse)Author
2019-07-26Add tls_handshake events for CONNECT through TLS proxiesLoïc Hoguin
2019-07-24Add the cancel event for local/remote stream cancellationLoïc Hoguin
2019-07-22Split domain lookup/connect/TLS handshake and add eventsLoïc Hoguin
This changes the way we connect to servers entirely. We now have three states when connecting (domain_lookup, connect and tls_handshake when applicable) and as a result three corresponding timeout options. Each state has a start/end event associated and the event data was tweaked to best match each event. Since the TLS handshake is separate, the transport_opts option was also split into two: tcp_opts and tls_opts.
2019-07-15Add Websocket frames related eventsLoïc Hoguin
2019-07-13Add ws_upgrade/protocol_changed eventsLoïc Hoguin
And ensure that Websocket triggers all the request/response events.
2019-06-02Add request_start, request_headers and request_end eventsLoïc Hoguin
2019-05-13Add the terminate eventLoïc Hoguin
2019-05-13Add the disconnect event callbackLoïc Hoguin
2019-05-08Add event_handler with init/connect_start/connect_endLoïc Hoguin
2019-04-26Add upgrade/ws tuples to gun:await/2,3,4Loïc Hoguin
2019-04-26Add specs to await functions, document error type betterLoïc Hoguin
2019-04-26Distinguish between error types in await functionsLoïc Hoguin
2019-04-26Rename owner_gone into owner_downLoïc Hoguin
2019-04-26Add the supervise option to start without supervisorLoïc Hoguin
2019-04-26No longer error out when the owner exitsLoïc Hoguin
No need to have the error repeated in the logs by the Gun process.
2019-04-25Remove explicit call to dbg:start/0Alexander Mihajlovic
This fixes a bug in `gun` when trying to open 2 connections with tracing enabled. You can recreate it like so: > application:ensure_all_started(gun). > gun:open("localhost", 80, #{trace => true}). > gun:open("localhost", 80, #{trace => true}). The second call fails with a cause clause exception. You'll observe the same exception by: > dbg:start(). > dbg:start(). Ultimately this may be a bug in OTP, but since `dbg:start/0` is undocumented I'm inclined to give it the benefit of the doubt. Regardless, since the docs[1] clearly state that calling `dbg:tracer/0` is the proper way to start the default tracer message receiver, I argue that calling `dbg:start/0` is a bug in `gun`. [1]: http://erlang.org/doc/man/dbg.html
2019-04-22Add origin_scheme checks to testsLoïc Hoguin
2019-04-22Make gun_tls_proxy work for HTTP/2 connectionsLoïc Hoguin
2019-04-19Integrate gun_tls_proxy into gun properLoïc Hoguin
Still need to add ALPN support and to wait before trying to send data on a proxied TLS connection that didn't complete its handshake.
2019-01-09Add function gun:stream_info/2Loïc Hoguin
2019-01-06Lowercase header names automatically and accept more typesLoïc Hoguin
Header names can now be provided as binary, string or atom and Gun no longer requires them to be in lowercase. The list of headers can also be provided as a map as well.
2019-01-05Don't send empty data chunksLoïc Hoguin
This was a bug in the case of HTTP/1.1 and an inconvenience in the case of HTTP/2.
2019-01-05Ensure Gun retries connecting immediatelyLoïc Hoguin
2019-01-03Update copyright yearsLoïc Hoguin
2019-01-03Consolidate origin server test helpersLoïc Hoguin
Also fixes an issue with switch_transport introduced when converting the Gun process to gen_statem.
2018-12-31Disable keepalive by default for HTTP/1.1Loïc Hoguin
This is safer as servers may reject too many extra empty lines.
2018-12-31Separate request/4,5,6 into headers/4,5 and request/5,6Loïc Hoguin
This cleaner separation gets rid of the implicit body check that was causing issues for many users. Now the body is either given explicitly or it is expected via future gun:data/3 calls.
2018-12-19Convert the gun process to gen_statemLoïc Hoguin
2018-10-30Switch to cow_http2_machine for HTTP/2Loïc Hoguin
A common state machine for Gun and Cowboy will be easier to maintain. This fixes numerous issues including some test failures that were hidden because the h2specd_SUITE was flawed. We temporarily depend on Cowlib master until a new version is released.
2018-10-01Document the protocols option for WebsocketMichal Piotrowski
2018-09-26Remove gun:dbg_send_raw/2Loïc Hoguin
The same can now be achieved using gun:info to retrieve the socket. This function was not documented and was only used in the old Cowboy test suite.
2018-09-26Add the socket in the gun:info mapLoïc Hoguin
This is used by Cowboy for tests.
2018-09-26Keep track of the intermediaries the connection go throughLoïc Hoguin
Also augment the CONNECT tests to confirm that the intermediaries are accounted for.
2018-09-20Use ALPN when proxying TLS connections using CONNECTLoïc Hoguin
This fixes HTTP/2 over TLS connections. The protocol destination option has been deprecated in favor of a protocols option.
2018-09-17Add HTTP/1.1 CONNECT supportLoïc Hoguin
Gun can now be used to connect through TCP HTTP/1.1 proxies using all supported protocols. It is also possible to create a tunnel through multiple proxies. Also updates Cowlib to 2.6.0.
2018-08-06Fix some whitespaceLoïc Hoguin
2018-07-27Fix OTP 21 warningsLoïc Hoguin
2018-06-04Update copyright yearsLoïc Hoguin
2018-06-04Remove the dependency on RanchLoïc Hoguin
We instead of two new modules, gun_tcp and gun_tls. They only have 6 functions so far, much less than what Ranch provided before. Also renames ssl to tls where applicable. It's still possible to use the ssl transport option but it's now undocumented.
2018-06-03Change messages to gun_upgrade and gun_ws with stream referenceLoïc Hoguin
2018-06-03Also flush trailersLoïc Hoguin
2018-06-03Fill in the options types instead of using map()Loïc Hoguin
2018-06-03Fix the inet:ip_address() typeLoïc Hoguin
2018-05-15Allow IP tuple for host #152Seudin Kasumovic
2018-01-22Add missing gun_inform clausesAndrei Nesterov
2017-12-16Add support for unix socketsmichael-coles
2017-12-14Change the {gone, Reason} to {shutdown, Reason} plus small fixesLoïc Hoguin
The reason for this change is to avoid annoying supervisor logs when SASL logging is enabled.
2017-11-15Add preliminary support for trailersLoïc Hoguin
The code is definitely not the best, but as long as it doesn't break anything it should be OK for now.
2017-10-29Add support for informational responsesLoïc Hoguin
2017-10-06Don't error out when the owner is gone normallyLoïc Hoguin