# http

## Usage

```bash
bdy tunnel http|HTTP [options] [protocol://host:port]
```

## Arguments

| **Argument** | **Description** |
| :--- | :--- |
| `protocol://host:port` | Target address to redirect traffic to. Host is optional and by default local machine. Port is by default 80 (optional) |

## Options

| **Option** | **Description** |
| :--- | :--- |
| `-r, --region <region>` | override default region ("eu", "us", "as") |
| `-w, --whitelist <cidrs...>` | Whitelist provided IP CIDRs. Use "*" to allow all |
| `-n, --name <name>` | Name of the tunnel |
| `-t, --timeout <seconds>` | Enforce connection timeout in seconds |
| `-h, --host <host>` | Provide custom HTTP host header |
| `--header <headers...>` | Header key:value to add to the request |
| `--response-header <headers...>` | Header key:value to add to the response |
| `--useragent <useragent...>` | Whitelist browser user-agent by contained text or regular expressions (e.g. /my-user-agent/). By Default all are allowed |
| `-a, --auth <user:pass>` | Enforce HTTP basic authorization |
| `-b, --buddy` | Enforce HTTP Buddy authorization |
| `-l, --log` | Log HTTP requests |
| `-v, --verify` | Enforce TLS verify |
| `-2, --http2` | Enforce HTTP/2 |
| `-c, --compression` | Turn on HTTP response compression |
| `--ca <ca>` | Path to a TLS PEM CA certificate for TLS auth |
| `--circuit-breaker <threshold>` | Turn on circuit breaker. Provide decimal value between 0 to 1 |
| `-s, --serve <directory>` | Serve files from a directory |
| `--token <token>` | Token to authorize agent |
| `--help` | display help for command |

## Examples

### Start http tunnel on port 80

```bash
bdy tunnel http 80
```

### Start named http tunnel and serve local directory

```bash
bdy tunnel http -n name -s /path/to/dir
```

### Start http tunnel, whitelist ip and turn on on basic auth

```bash
bdy tunnel http https://myhost.com -w 1.1.1.1 -a user:pass
```


---
Original source: https://buddy.works/docs/cli/tunnel/http