Ryan Dahl
1c5d5e0b72
uppercase request methods
14 years ago
Ben Noordhuis
4b19bd2896
Client.onend: Anticipate that the HTTP parser object is uninitialized when the client setup failed.
14 years ago
Mikeal Rogers
3214116be6
Implement keep-alive for http.Client
Send the 'Connection: keep-alive' header in your request to enable.
14 years ago
Ryan Dahl
02729d4af7
instanceof Buffer to Buffer.isBuffer()
15 years ago
Ryan Dahl
6a57a42109
Use Array.isArray instead of instanceof
15 years ago
Dmitriy Shalashov
70a8fb3763
Fix headers with empty value.
15 years ago
Peter Griess
51bd1b4483
Only concatenate some incoming HTTP headers.
- Concatenate 'accept', 'accept-charset', 'accept-encoding',
'accept-language', 'connection', 'cookie', and 'x-*' headers.
- For all others, drop duplicates.
15 years ago
Peter Griess
187f191558
Support 'upgrade' event in HTTP client.
- Add a unit test for client HTTP upgrade.
- Move around unit tests for server HTTP upgrade.
15 years ago
Ryan Dahl
6bed15e074
Refactor: Utf8Decoder -> StringDecoder
Instead of just decoding Utf8, this will proxy requests to buffer.toString()
for other encodings. This makes for a simpler interface.
15 years ago
Ryan Dahl
55a6f01732
Server responses should have a body if HEAD request
15 years ago
Ryan Dahl
80a8e71fe0
Insert some hot paths into HTTP
15 years ago
Ryan Dahl
74b7fa29a1
Refactor HTTP
Allow throttling from outgoing messages.
15 years ago
Ryan Dahl
29e867aaa0
Simplify a few internal HTTP events.
15 years ago
Sam Hughes
895f89d62a
Avoided sending empty chunkedEncoding chunks in the middle of http responses
15 years ago
Ryan Dahl
15ec99ec59
Fix issue 89, parsing responses to HEAD requests
Test from Mark Hansen (mark at markhansen.co.nz)
15 years ago
Ryan Dahl
35c14f637e
In HTTP parser, proxy return value of onHeadersComplete
15 years ago
Ben Noordhuis
b58db3cd73
Added reason phrases for a bunch of HTTP status codes.
15 years ago
Ryan Dahl
cbd2c3945b
Throwing in a callback should kill the process
There is a difference between errors which happen to a socket - like
receiving EPIPE - an exceptional situation but ultimately okay and the
situation where code throws in a callback - which is not okay.
Fixes test/simple/test-http-exceptions.js
TODO: explain this in docs.
15 years ago
Ryan Dahl
2663c69f8d
Fix utf8stream references
15 years ago
Felix Geisendörfer
f987ecf45b
Use Utf8Stream for http Streams with utf8 encoding
15 years ago
Ryan Dahl
d0128787e7
Deprecate sendHeader() and writeHeader(), ppl should use writeHead()
15 years ago
Ryan Dahl
7a2e6d674a
Default to 2 second timeout for http servers
Taking a performance hit on 'hello world' benchmark by enabling this by
default, but I think it's worth it. Hopefully we can improve performance by
resetting the timeout less often - ideally a 'hello world' benchmark would
only touch the one timer once - if it runs in less than 2 seconds. The rest
should be just link list manipulations.
15 years ago
Ryan Dahl
8ab238e7de
Revert "destroy instead of end http connection at end of pipeline"
This reverts commit 4ce1e1fca5
.
To fix test-http-full-response.js. Clearly this is not the correct solution.
Probably need idle timeouts.
15 years ago
Ryan Dahl
4ce1e1fca5
destroy instead of end http connection at end of pipeline
15 years ago
Thomas Lee
3674563dd5
Fix a bug in http.Client where parsers may be prematurely released back to the free pool.
15 years ago
Ryan Dahl
453c9e6411
Fix whitespace
15 years ago
isaacs
3892628657
Emit a better error message when something strange is sent to OutgoingMessage#write
15 years ago
Ryan Dahl
b5bdf9434b
Add another http upgrade test
15 years ago
Ryan Dahl
f0fec7352a
Don't emit error twice from http.Client
15 years ago
Micheil Smith
aee226b243
Fixing the 1 byte off error in http.Server's upgradeHead
(And fix up some style issues)
15 years ago
Ryan Dahl
67fb0ece6b
Fix deprecation message
15 years ago
Micheil Smith
d6110fbd11
Making requestListener for the construction of a http.Server optional, as it is for net.Server
15 years ago
Micheil Smith
f990f24ad3
Implementing the event emit for Upgrade requests, with tests.
15 years ago
Ryan Dahl
3b323027be
http server emits 'clientError'
15 years ago
Ryan Dahl
6abdf051d3
Unhandled 'error' events kill program
By default 'error' throws. addListener to prevent this.
15 years ago
Ryan Dahl
3934cb5485
Force no body on http 204 and 304
Thanks to tjholowayhuk@gmail.com for the test case.
15 years ago
Micheil Smith
6ad18a27a0
Fix upgradeHead bounds.
15 years ago
Ryan Dahl
760bba5518
Support Upgrade in HTTP messages
This allows for web servers to be "hijacked" and used as Web Socket servers
(or other). You simply listen for requests as normal, but check if
req.upgrade === true
If so, this will be the last request of the connection. It's your job now to
hijack req.connection and start reading from it. req.upgradeHead is a buffer
containing the first part of the new protocol communication (in the case it
arrived on the same packet).
This needs tests and documentation. API subject to change.
15 years ago
Micheil Smith
57ea07ac91
Moving the http.js, net.js FreeList to being standalone.
15 years ago
Ryan Dahl
b7947e45c0
Recycle http client parsers
15 years ago
Rhys Jones
80174392bb
Moved Credentials into crypto module. Added node_crypto into crypto module
15 years ago
Rhys Jones
45b8d24ea6
Added https server support
15 years ago
Rhys Jones
c9f71a807c
Added https support
15 years ago
Tim Caswell
62d9852c3d
Replace slow and broken for..in loops with faster for loops over the keys.
15 years ago
Ryan Dahl
8553e8a15d
Add incoming.httpVersion
15 years ago
Ryan Dahl
08a09bb50a
Use some more Binary/F methods for Buffer
15 years ago
Ryan Dahl
50c70ac714
Update stream API: forceClose() -> destroy(), close() -> end()
15 years ago
Ryan Dahl
1b758ef268
Allow stream to write on close
15 years ago
Ryan Dahl
53530e981a
Fix test-http-chunked. Need to check for \0 at end of utf8 strings
15 years ago
Ryan Dahl
3546106c43
Add req.connection and res.connection
15 years ago