Matthew Wild
0829bb1a04
net.http: track time of request for debug/stats purposes
6 years ago
Matthew Wild
4cca54ff5a
net.http: Add support for streaming chunked/large responses
6 years ago
Matthew Wild
eb8d78cb7e
net.http: Add feature discovery (currently just contains SNI)
6 years ago
Kim Alvefur
f7e5fa95ca
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
6 years ago
Matthew Wild
f3796f6c52
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.
6 years ago
Matthew Wild
cf70cc4547
net.http: Re-expose destroy_request() function
...
This was accidentally turned private in 647adfd8f738 as part of refactoring
for Lua 5.2+.
6 years ago
Matthew Wild
4c8ea3a414
net.http: Fix traceback on invalid URL passed to request()
6 years ago
Matthew Wild
f8c7c8fd53
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.
6 years ago
Matthew Wild
80616c004c
net.http: use new net.http.errors lib for creating error object
6 years ago
Kim Alvefur
173c10f232
net.http: Return a Promise if no callback is given
6 years ago
Kim Alvefur
e0a077e53b
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.
7 years ago
Kim Alvefur
a56dab0d87
net.http: Pass server name along for SNI ( fixes #1408 )
...
net.resolver.basic passes this 'extra' field along to server.addclient
7 years ago
Kim Alvefur
90b6787b47
net.*: Remove tostring call from logging
...
Taken care of by loggingmanager now
7 years ago
Kim Alvefur
c500a82e46
net.http: Manually merge settings ( fixes #1231 )
...
Metatable table indexing is done raw, so metatables can't be chained
8 years ago
Matthew Wild
9b5c6c4d9d
Many things: switch from hacky multi-arg xpcall implementations to a standard util.xpcall
8 years ago
Kim Alvefur
399f42a003
net.http: Import setmetatable into local scope ( fixes #1125 )
8 years ago
Matthew Wild
bef96be8a0
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
672ab9595b
net.http: Add option for disabling TLS certifictate validation
9 years ago
Kim Alvefur
6f427fed5d
net.http: Validate HTTPS certificates ( fixes #659 )
9 years ago
Kim Alvefur
eb481bfb43
net.http: Move default SSL/TLS settings into options, allowing them to be overriden in new()
9 years ago
Kim Alvefur
41ea79ea50
net.http: Expose defaults
9 years ago
Kim Alvefur
4590e4d9ee
net.http: Remove duplicate 'request' entry
9 years ago
Matthew Wild
5862c92aa4
net.http: Add request.url, which is the original full URL as a string
9 years ago
Matthew Wild
85bb54060c
net.http: Fire new events: pre-request, request-connection-error, request, response
9 years ago
Matthew Wild
527e6d6086
net.http: Allow creation of http client objects, with custom options
9 years ago
Kim Alvefur
3811ceb6ca
net.http: Pass error all the way to callback
9 years ago
Matthew Wild
3a59dfeb6a
net.http: Allow enabling/disabling error suppression, useful for tests
8 years ago
Matthew Wild
627e377370
net.http: Fix for Lua 5.2: return error from error handler (xpcall changed)
8 years ago
Kim Alvefur
146acdbd33
vairious: Add annotation when an empty environment is set [luacheck]
8 years ago
Matthew Wild
653a61753e
net.http: Refactor to use new net.connect API, brings support for async DNS
8 years ago
Matthew Wild
f5cb629ca2
net.http: Rename handler to conn, for consistency with all our other code
8 years ago
Matthew Wild
74fcf735d9
net.http: Remove use of 'conn' (raw socket object returned by addclient)
8 years ago
Kim Alvefur
ddb503576f
net.http: Strip trailing whitespace
10 years ago
Kim Alvefur
3f2bb3f817
net.http: Remove unused imports [luacheck]
10 years ago
Matthew Wild
85547f3e74
net.http: Add quotes around ids in log messages
10 years ago
Matthew Wild
2ba75409ab
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
a92512707c
net.http: Add request.id to every request object (can be overridden by providing ex.id)
10 years ago
Kim Alvefur
9ed000c898
net.*: Remove use of module() function
11 years ago
Matthew Wild
c5d0345453
certmanager, net.http: Disable SSLv3 by default
12 years ago
Matthew Wild
58edf57b1f
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
80589aacf6
net/http: Use server.addclient
13 years ago
daurnimator
8184587aa4
net/http: Use server.addclient
13 years ago
Matthew Wild
741e58831a
net.http: assert() for socket creation success so it doesn't silently fail (thanks daurnimator)
13 years ago
Florian Zeitz
4b618a8727
Remove all trailing whitespace
13 years ago
Matthew Wild
871b368671
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
70e81c21b7
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
c63dc9181d
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
8432300448
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
398145c109
net.http: Swap response and request parameters passed to callback (will break some modules)
13 years ago
Matthew Wild
607cae48bf
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