Age | Commit message (Collapse) | Author |
|
Otherwise this can mess up the underlying protocol we will
switch to, like TLS or HTTP/2.
|
|
Also augment the CONNECT tests to confirm that the
intermediaries are accounted for.
|
|
This fixes HTTP/2 over TLS connections.
The protocol destination option has been deprecated in favor
of a protocols option.
|
|
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.
|
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This is a bit less efficient but necessary in case we
start getting the beginning of \r\n\r\n and it cuts just
there.
|
|
The code is definitely not the best, but as long as it doesn't
break anything it should be OK for now.
|
|
|
|
This disables the keepalive mechanism entirely.
|
|
|
|
|
|
This functionality can be used to implement custom protocols
on top of Websocket, but may also be used to decode frame
contents on the fly if necessary.
The default_protocol option defines what module should be
used when no protocol was selected.
The protocols option is a list of key/value pairs used to
select the handler depending on the protocol that the server
accepted.
The feature is currently experimental.
|
|
Content handlers are a chain of modules implementing callbacks
that receive the body of responses and may modify it (for example
for decompressing the content) or act upon it (like sending a
message to the owner process.
The gun_sse content handler module can be used to translate
text/event-stream events on the fly and deliver them to the
owner process as a {gun_sse...} message.
This feature is currently not documented and is only tested
against a public server. It requires an up to date Cowlib.
|
|
|
|
No response body is expected from now on.
|
|
Oops!
|
|
Thanks @petrohi for the initial patch.
|
|
Oops! Thanks everyone who reported/submitted patches.
|
|
When we stream content we need to set this header manually
from Gun.
|
|
|
|
Also improves the code and documentation about this message.
It was incorrectly specified that a gun_ws_upgrade message
could be sent on error; instead a gun_response is sent.
|
|
|
|
The flush(Pid) function was enhanced to also discard Websocket
messages and the new up/down messages.
|
|
map:to_list -> maps:to_list
Only call maps:to_list once.
|
|
The type option has been removed. The transport and protocols
options can be used in its place.
The transport_opts option can be used to specify transport
options.
The http_opts and spdy_opts options can be used to specify
protocol specific options.
The keepalive option is now a protocol specific option.
Defaults depending on the port number have changed. Now only
port 443 uses ssl by default, other ports use tcp.
|
|
|
|
The content-type and content-length alone indicate whether a
body is present for request/4.
The host header can now be overriden.
A number of headers like transfer-encoding are automatically
deleted from the list of headers we receive. SPDY also deletes
connection, keep-alive and proxy-connection.
SPDY now sends the port in the :host header.
|
|
|
|
All autobahntestsuite tests pass including the permessage-deflate
compression tests.
Some of the tests pass in a non-strict fashion. They are testing
for protocol errors and expect events to happen in a particular
order, which is not respected by Gun. Gun fails earlier than is
expected due to concurrent processing of frames.
The implementation when error occurs during handshake is probably
a bit rough at this point. The documentation is also incomplete
and/or wrong at this time, though this is the general state of
the Gun documentation and will be resolved in a separate commit.
|
|
Per extend/gun#22 we need to return body until server closes
connection when server doesn't specify content-length and
transfer-encoding
|
|
A linebreak was sometimes introduced in the middle of the request
body.
|
|
This happens because handle/2 is actually a loop.
|
|
|
|
|
|
This way the issue fixed by the previous commit won't happen again.
|
|
|
|
Thanks David Cartt for reporting it.
|
|
|
|
|
|
Support for HTTP/1.1 and compatibility with HTTP/1.0.
|