Skip to main content

Client

The Narrowlink client is a crucial component that acts as an interface for sending and receiving packets to and from agents, forwarding them to the Narrowlink network infrastructure. Installed on end user devices, this component facilitates seamless communication with the Agent component. Clients interact with the gateway to securely access resources located behind firewalls, enabling remote access from anywhere.

The Narrowlink client is responsible for the following tasks:

  • Sharing internet access of a computer behind NAT networks by setting up a local SOCKS5 proxy server or TUN interface.
  • Establishing peer-to-peer connectivity between the client and agent.
  • Enabling TCP and UDP port forwarding to connect to agent-side services.
  • Implementing end-to-end encryption based on Xchacha20Poly1305 and SHA3-based HMAC-256 for signing the remote address.
  • Providing a netcat-like interface for connecting to agent network services.
  • Checking the status of agents connected to the gateway.

Configuration

The client needs to be configured with the address of the gateway and a token. The token can be generated using the Token Generator component.

The configuration comprises the following parameters as a YAML file:

endpoints:
- !SelfHosted # Self hosted endpoint, more options coming soon
gateway: gateway.domain.example:443 # address of the gateway
token: eyJ0eX....kNHYQ_4 # token for authentication
#protocol: Wss # Wss or Ws (default: Wss)

Default Configuration Paths

The client can load configuration from a custom path using the -c or --config flag or from its default paths.

The default paths are as follows:

  1. Next to the client executable file with the name client.yaml
  2. In the operating system's configuration directory within a folder named .narrowlink, with the file named client.yaml

Example path:

$HOME/.narrowlink/client.yaml
  1. In the operating system's configuration directory within a folder named narrowlink, with the file named client.yaml

Configuration paths for different operating systems:

OSPATH
Linux/home/<username>/.config/narrowlink/client.yaml
MacOS/home/<username>/.config/narrowlink/client.yaml
Windows/home/<username>/.config/narrowlink/client.yaml

To explore more features and options, refer to the Extended Tutorial section or experiment with different command line options.