Http connection constructor, signature synced to native version for compatibility
(native only) leave undefined
endpoint to connection with
port to connect to
Optional
socketOptions: SocketOptions(native only) leave undefined
Optional
tlsOptions: TlsConnectionOptionsinstantiate for TLS, but actual value is unused in browse implementation
Optional
proxyOptions: HttpProxyOptionsoptions to control proxy usage when establishing the connection
Forces all written events to be buffered in memory. The buffered data will be flushed when uncork is called.
Synchronously calls each of the listeners registered for the event key supplied in registration order. If the BufferedEventEmitter is currently corked, the event will be buffered until uncork is called.
The name of the event
Rest
...args: any[]Event payload
Make a client initiated request to this connection.
The HttpRequest to attempt on this connection
A new stream that will deliver events for the request
Flushes all data buffered since cork was called.
NOTE: It is HIGHLY recommended that uncorking should always be done via
process.nextTick
, not during the EventEmitter.on()
call.
Static
CLOSEEmitted when the connection has completed
Static
CONNECTEmitted when the connection is connected and ready to start streams
Static
ERROREmitted when an error occurs on the connection
Generated using TypeDoc
Represents an HTTP connection from a client to a server