Sockets
Establish a socket connection between Impervious nodes. Trade IP:PORT:PROTOCOL with clients.
Potential Applications: Out of Band STUN/TURN/ICE for Streaming Video, VoIP, help organize NAT punch-through(UPNP), etc.
S2S allows for two computers to use IMP as a secure third party/rendezvous point for the purpose of trading enough technical data to build an open, clear channel to each other. This is different than the VPN, whereby the VPN builds a NETWORK...S2S helps endpoints which cannot directly talk to each other build a data pipe. This data pipe, could be used for video streaming, VoIP, etc.
S2S only supports UDP, and requires the far end clients to send at least one empty UDP packet from their application for the relay to to stash the source IP and port, then forwarding will begin. This is a REQUIREMENT. Failure to setup the relay with an initial (can be empty) packet, will fail to forward.
Technical bits: NAT/PAT firewalls read and track five items: source IP, destination IP, source port, destination port, and protocol. When one's app transmits a UDP packet toward the relay, the NAT/PAT firewall will track these five items and then performs PAT, which changes the source port just as it exits the WAN interface. The app never knows this, therefore the relay will track this IP:PORT combo so that it can return traffic back towards the user.
The relay does not monitor traffic. I strictly reads IP:PORT for both users, swaps payloads and then forwards back down to the opposite ends.
The API will return the relay's IP, and two UDP port. It is the developer's responsibility to forward this data to the two interested endpoints securely. Perhaps try using the messaging API!

SECURITY WARNING: The ports are wide open. They can accept injected traffic. Do your best to firewall these ports to just the users one wishes. A creative developer could auto generate firewall rules...
Allows for p2p sockets to be established between Impervious nodes
Socket service allows for p2p sockets to be established between Impervious nodes.
Method Name | Request Type | Response Type | Description |
SendSocket | SendSocketRequest | SendSocketResponse | SendSocket sends a socket request to another node. |
StartSocket | StartSocketRequest | StartSocketResponse | StartSocket starts the socket on your Impervious node. |
StopSocket | StopSocketRequest | StopSocketResponse | StopSocket stops the socket on your Impervious node. |
Method Name | Method | Pattern |
SendSocket | POST | /v1/socket/sendRequest |
StartSocket | POST | /v1/socket/start |
StopSocket | POST | /v1/socket/stop |
Represents a request to send socket connection information to a far end node
Field | Type | Label | Description |
pubkey | string | | The public key of the far end LND node running IMP |
Represents a response back from the request to establish a socket
Field | Type | Label | Description |
id | string | | returned message ID |
Represents a request to start a socket on an owned IMP node
Represents a response containing socket information from a started socket
Field | Type | Label | Description |
protocol | string | | the protocol of the socket connection |
ip | string | | the ip of the IMP node to connect to |
port1 | string | | the first port of the socket connection |
port2 | string | | the second port of the socket connection |
Represents a request to stop a socket on an owned IMP node
Represents a response back from a stopped socket
.proto Type | C++ | Java | Python | Go | C# | PHP | Ruby |
double | double | double | float | float64 | double | float | Float |
float | float | float | float | float32 | float | float | Float |
int32 | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
int64 | int64 | long | int/long | int64 | long | integer/string | Bignum |
uint32 | uint32 | int | int/long | uint32 | uint | integer | Bignum or Fixnum (as required) |
uint64 | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum or Fixnum (as required) |
sint32 | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sint64 | int64 | long | int/long | int64 | long | integer/string | Bignum |
fixed32 | uint32 | int | int | uint32 | uint | integer | Bignum or Fixnum (as required) |
fixed64 | uint64 | long | int/long | uint64 | ulong | integer/string | Bignum |
sfixed32 | int32 | int | int | int32 | int | integer | Bignum or Fixnum (as required) |
sfixed64 | int64 | long | int/long | int64 | long | integer/string | Bignum |
bool | bool | boolean | boolean | bool | bool | boolean | TrueClass/FalseClass |
string | string | String | str/unicode | string | string | string | String (UTF-8) |
bytes | string | ByteString | str | []byte | ByteString | string | String (ASCII-8BIT) |
Last modified 1yr ago