# NetUtils Skills

Skills URL: https://netutils.lessokaji.com/skills.md

## Download The Client

Linux:

```bash
curl -LO https://netutils.lessokaji.com/download/netutils-linux-x64.tar.gz
tar -xzf netutils-linux-x64.tar.gz
./netutils --help
```

Windows:

```powershell
curl.exe -LO https://netutils.lessokaji.com/download/netutils-win-x64.zip
Expand-Archive .\netutils-win-x64.zip
.\netutils-win-x64\netutils.exe --help
```

## Run The Server

Run this on the tunnel server:

```bash
./netutils.lessokaji server --config /etc/netutil/server.json
```

The server config owns mapping ports, bind mode, management login, management API keys, and persistent traffic counters.

## Provide A Port

Run this on the machine that owns the destination service:

```bash
./netutils client --server netutils.lessokaji.com --server-port 51234 --apikey MAPPING_API_KEY --destination 127.0.0.1:8888 --workers 32
```

The mapping API key is the provider credential. It connects the destination service to the mapping port on the tunnel server.

## Use A Provided Port

If the mapping is public, connect to the server host and mapping port:

```bash
curl http://lessokaji.com:PORT/
```

If the mapping is local-only, use a server-local process in front of that port or use the P2P local listener below.

## Provide A Port With P2P

The provider can also register a P2P target for the same mapping:

```bash
./netutils client --p2p-target --server netutils.lessokaji.com --server-port 51234 --apikey MAPPING_API_KEY --peer-id default --destination 127.0.0.1:8888
```

The mapping must have `Allow P2P connection` enabled and a client API key set in the dashboard.

## Use A Provided Port With P2P

Run this locally with the mapping's client API key:

```bash
./netutils client --p2p-listen --server netutils.lessokaji.com --server-port 51234 --apikey CLIENT_API_KEY --listen 127.0.0.1:8888 --target-peer default --destination 127.0.0.1:8888
curl http://127.0.0.1:8888/
```

The local listener first tries P2P through the tunnel server rendezvous path. If you configure `--fallback host:port`, it can fall back to a relay endpoint.
