MockTLSServer

MockTLSServer

A TLS server that mocks the network, but all of the crypto code is real.

Constructor

new MockTLSServer(optionsopt, secureConnectionListeneropt)

Create a MockTLSServer instance.
Source:
Parameters:
Name Type Attributes Description
options ServerOpts | SecureConnectionCallback <optional>
Server options.
secureConnectionListener SecureConnectionCallback <optional>
Installed as a listener for the 'secureConnection' event.

Classes

MockTLSServer

Methods

listen(optionsopt, secureConnectionListeneropt) → {MockTLSServer}

Listen for incoming connections. Whenever `connect` is called on this server's port, create a mock socket wrapped in a TLSSocket.
Source:
Parameters:
Name Type Attributes Description
options number | ListenOptions <optional>
Port number or options object.
secureConnectionListener function <optional>
If it exists, installed as a listener for the 'secureConnection' event.
Returns:
Type:
MockTLSServer
This.