Matthew Wild
b50d4b2ef0
net.http: Add support for streaming chunked/large responses
5 years ago
Matthew Wild
047f03ec09
net.http: Add feature discovery (currently just contains SNI)
5 years ago
Kim Alvefur
93d0d13fbb
net.server: Backport client parts of SNI support from trunk ( #409 )
...
Partial backports of the following commits from trunk:
6c804b6b2ca2 net.http: Pass server name along for SNI (fixes #1408 )
75d2874502c3 net.server_select: SNI support (#409 )
9a905888b96c net.server_event: Add SNI support (#409 )
adc0672b700e net.server_epoll: Add support for SNI (#409 )
d4390c427a66 net.server: Handle server name (SNI) as extra argument
5 years ago
Matthew Wild
dc206f0ff4
net.http: Add request:cancel() method
...
This is a new API that should be used in preference to http.destroy_request()
when possible, as it ensures the callback is always called (with an error of
course).
APIs that have edge-cases where they don't call callbacks have, from experience,
shown to be difficult to work with and often lead to unintentional leaks when
the callback was expected to free up certain resources.
5 years ago
Matthew Wild
11e49af5e8
net.http: Re-expose destroy_request() function
...
This was accidentally turned private in 647adfd8f738 as part of refactoring
for Lua 5.2+.
5 years ago
Matthew Wild
bfd9789cb1
net.http: Fix traceback on invalid URL passed to request()
6 years ago
Matthew Wild
c340e3ab37
net.http: http.request() promise now resolves with response (breaking change)
...
Promise mode is not (widely?) used, changing this now while we can, as it
improves usability of the API.
The request is now available as response.request, if needed.
5 years ago
Matthew Wild
209660f212
net.http: use new net.http.errors lib for creating error object
5 years ago
Kim Alvefur
7d924c49ac
net.http: Return a Promise if no callback is given
6 years ago
Kim Alvefur
e354f1abd8
net.http: Set ALPN on requests
...
Shouldn't hurt. Revert if it turns out it does.
Supported in LuaSec 0.8. Should be ignored otherwise.
6 years ago
Kim Alvefur
92b963270a
net.http: Pass server name along for SNI ( fixes #1408 )
...
net.resolver.basic passes this 'extra' field along to server.addclient
6 years ago
Kim Alvefur
75bfec7731
net.*: Remove tostring call from logging
...
Taken care of by loggingmanager now
7 years ago
Kim Alvefur
8226d6de4c
net.http: Manually merge settings ( fixes #1231 )
...
Metatable table indexing is done raw, so metatables can't be chained
7 years ago
Matthew Wild
f5f6460b2e
Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall
7 years ago
Kim Alvefur
bb47d9eed0
net.http: Import setmetatable into local scope ( fixes #1125 )
8 years ago
Matthew Wild
0e4c35dd86
net.http: Fix parameter order to http request callbacks
...
Commit e3b9dc9dd940 changed the parameter order in 2013, but did not update the names of the parameters in the callback function. Due to this inconsistency, 12df41a5a4b1 accidentally reversed the order when fixing the variable names without fixing where they are used.
Additionally the documentation was incorrect (since 2013), and this has also now been fixed.
8 years ago
Kim Alvefur
7e28119b3d
net.http: Add option for disabling TLS certifictate validation
9 years ago
Kim Alvefur
e605ac0987
net.http: Validate HTTPS certificates ( fixes #659 )
9 years ago
Kim Alvefur
708ce26bc8
net.http: Move default SSL/TLS settings into options, allowing them to be overriden in new()
9 years ago
Kim Alvefur
450544aad0
net.http: Expose defaults
9 years ago
Kim Alvefur
10d48f1bad
net.http: Remove duplicate 'request' entry
9 years ago
Matthew Wild
3371e3eae3
net.http: Add request.url, which is the original full URL as a string
9 years ago
Matthew Wild
66a3d68d56
net.http: Fire new events: pre-request, request-connection-error, request, response
9 years ago
Matthew Wild
04d3816b69
net.http: Allow creation of http client objects, with custom options
9 years ago
Kim Alvefur
3e7bffe8c8
net.http: Pass error all the way to callback
9 years ago
Matthew Wild
e944901cf2
net.http: Allow enabling/disabling error suppression, useful for tests
8 years ago
Matthew Wild
cf9743127c
net.http: Fix for Lua 5.2: return error from error handler (xpcall changed)
8 years ago
Kim Alvefur
43b814a83b
vairious: Add annotation when an empty environment is set [luacheck]
8 years ago
Matthew Wild
5e69368eeb
net.http: Refactor to use new net.connect API, brings support for async DNS
8 years ago
Matthew Wild
c26b05eaf2
net.http: Rename handler to conn, for consistency with all our other code
8 years ago
Matthew Wild
a761524e28
net.http: Remove use of 'conn' (raw socket object returned by addclient)
8 years ago
Kim Alvefur
6d2a83e077
net.http: Strip trailing whitespace
9 years ago
Kim Alvefur
e14306d742
net.http: Remove unused imports [luacheck]
9 years ago
Matthew Wild
5a7fc4ca74
net.http: Add quotes around ids in log messages
10 years ago
Matthew Wild
22ce4d1825
net.http: Add log messages for requests, including their id (so "calling callback" and tracebacks can be traced back to their initial request)
10 years ago
Matthew Wild
fc9bcc9b20
net.http: Add request.id to every request object (can be overridden by providing ex.id)
10 years ago
Kim Alvefur
69652ea24b
net.*: Remove use of module() function
11 years ago
Matthew Wild
26cd63e77f
certmanager, net.http: Disable SSLv3 by default
11 years ago
Matthew Wild
899b6d53ae
net.http, net.http.server, mod_c2s, mod_s2s, mod_component, mod_admin_telnet, mod_net_multiplex: Add ondetach to release connection from 'sessions' table (or equivalent)
12 years ago
daurnimator
5c7f981a77
net/http: Use server.addclient
12 years ago
daurnimator
5c25cdaa77
net/http: Use server.addclient
12 years ago
Matthew Wild
edb2882b96
net.http: assert() for socket creation success so it doesn't silently fail (thanks daurnimator)
12 years ago
Florian Zeitz
1d833bb807
Remove all trailing whitespace
13 years ago
Matthew Wild
3ad5836d2e
net.http: Include port number (when non-standard) in the Host header of outgoing requests, as per the HTTP RFC
13 years ago
Matthew Wild
c178786878
mod_c2s, mod_s2s, net.http, net.http.server: Improve tracebacks (omit traceback function), to make it clearer where an error occured
13 years ago
Matthew Wild
4602591c38
mod_c2s, mod_s2s, net.http, net.http.server: Improve tracebacks (omit traceback function), to make it clearer where an error occured
13 years ago
Matthew Wild
6dced9f482
net.http: When HTTP request fails due to a network or SSL error, call the callback to let it know
13 years ago
Matthew Wild
ef9b86202e
net.http: Swap response and request parameters passed to callback (will break some modules)
13 years ago
Matthew Wild
218b8844b4
net.http: Switch from util.httpstream to net.http.parser, introduces small but backwards-incompatible API changes - see http://prosody.im/doc/developers/http
13 years ago
Matthew Wild
8994b3afd1
net.http, util.http: Move definitions of urlencode/decode and formencode/decode to util.http (possible to use them without unnecessary network-related dependencies)
13 years ago