Snarl Network Protocol (Legacy)


The Snarl Network Protocol (SNP) provides simple access to both local and remote instances of Snarl.  It is TCP-based and thus the sending computer need not be running Snarl (or Windows) - so long as it can connect via TCP/IP to a remote computer running Snarl, it will be able to send notifications.

Note: Support for SNP 1.0 is now deprecated and applications are encouraged to use the current version of the protocol - SNP 3.0.

Communication Overview

Communication takes place using TCP via port 9887.  Typically it is down to the client to manage the connection and terminate it when no further communication is required, however in some cases Snarl may terminate the connection (due to malformed messages, security concerns, etc.).

The communication process is as follows:
  1. Client creates a socket
  2. Client connects to Snarl running on the required host on TCP port 9887
  3. Client sends request
  4. Client receives reply
  5. Steps 3 and 4 repeat
  6. Client ends connection
Callback events and notifications forwarded as the result of a subscription will also be received by the client.

The client may choose to create a new socket for each request, or re-use an existing socket.  If the client is expecting to handle callbacks then it should ensure the socket remains open at least until the callback is received.  If a client has subscribed for notifications from a remote computer, it must leave the socket open in order to receive notifications sent by the remote computer.

Request Structure

SNP 1.0


SNP 2.0

An SNP 2.0 request follows this pattern:

snp://<command>[?<argument>=<value>[&<argument>=<value>]] CR

Note the following:
  • Each request must begin with snp://
  • Each request must end with a single Carriage Return (0x0D)
  • Each request must contain at least a command
Example Request

snp://reg?id=test/test&title=Test Application&password=password

Response Structure

SNP 1.0


SNP 2.0

An SNP 2.0 response follows this pattern:

SNP/<version>/<status code>/<description>[/<data>]

version The highest version of SNP the running instance of Snarl supports 
status code The status code of the last request 
descriptionA human-readable representation of the status code
data Additional data - this is specific to the individual request 

Example Response



SNP 1.0


SNP 2.0

Details about it here