new SecureConnection(_socket, _aesKey)
Creates an easy to use connection instance
Parameters:
Name | Type | Description |
---|---|---|
_socket |
net.Socket | The socket of said connection |
_aesKey |
string | The already established aes key |
- Source:
Methods
on(event, listener) → {SecureConnection}
Listen to an event
Parameters:
Name | Type | Description |
---|---|---|
event |
string | |
listener |
function |
- Source:
Returns:
- Type
- SecureConnection
sendData(type, data) → {SecureConnection}
Sends data. I wouldn't recommend using this function directly.
Parameters:
Name | Type | Description |
---|---|---|
type |
string | The type of data to send |
data |
Object | The data to send |
- Source:
- See:
-
- sendJson
Returns:
- Type
- SecureConnection
sendFile(name, content) → {SecureConnection}
Sends file data
Parameters:
Name | Type | Description |
---|---|---|
name |
string | The name of the file to send |
content |
Buffer | The file data to send |
- Source:
Returns:
- Type
- SecureConnection
sendJson(json) → {SecureConnection}
Sends JSON data
Parameters:
Name | Type | Description |
---|---|---|
json |
Object | The JSON to send |
- Source:
Returns:
- Type
- SecureConnection