N: devicespec - FujiNetWIFI/fujinet-firmware GitHub Wiki

The N: Device spec consists of an RFC compliant URL, which encodes:

  • Protocol Scheme
  • Host
  • Port # (optional)
  • Path to some resource e.g. file (optional)
  • Any URL encoded query parameters (e.g. for HTTP)

TCP

TCP Connections can be made to any host or port.

Client connections

N:TCP://192.168.1.2:2000/

Connects to the host at 192.168.1.2 port 2000.

Server connections

N:TCP://:2000/

Opens a listening connection on port 2000 of the ESP, which someone else can connect to. Once a client is connected, the connection should be accepted, so that it can be used for I/O.

UDP

UDP protocol works similarly, except that there is no actual connection. Setting a hostname merely specifies where the next packets written will be sent. The Port number is required, and specifies not only the destination port for UDP packets, but also the listening ports for UDP packets to be received.

N:UDP://bob.foo.com:2000/

Indicates that UDP packets should be sent to the hostname bob.foo.com port 2000.

While,

N:UDP://:2000/

Indicates that there is no default destination address to start with, but to listen for UDP packets on port 2000.

Once a packet is received, the destination address is sent to the remote address and port of the packet received, so that the next write will reply back to it, as a convenience.

HTTP/HTTPS

HTTP and HTTPS connections can be made to specific URLs. e.g.

N:HTTP://WWW.GOOGLE.COM/
N:HTTPS://WWW.TWITTER.COM/
N:HTTP://35.239.67.240/BURIEDBU.COM

TNFS

TNFS connections can be made to TNFS servers. If a port is not specified, the default UDP port of 16384 is assumed.

N:TNFS://TMA-1/

FTP

FTP connections can be made with the following URL format:

N:FTP://[user:password@]hostname/path

Username and password are optional, if not specified, then anonymous and [email protected] are used, respectively, for Anonymous FTP login.

FTP://FTP.PIGWA.NET/pub/collections/holmes cd/Holmes 2/Atari Archives/Antic Files/88/FROG.EXE