You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extended tunnel and added a cli subcommand for it (#5)
* feat: Extended tunnel and added a cli subcommand for it
- Added `aesgcm_conn.go` to provide AES-GCM encryption for net.Conn.
- Introduced `NewAESGCMConn` function for creating encrypted connections.
- Implemented Read and Write methods for encrypted data transmission.
- Added tests in `aesgcm_conn_test.go` to validate encryption and decryption functionality.
- Created a command-line tool in `cmd/netx` for establishing secure tunnels with chainable transforms.
- Implemented UDP and TCP echo servers and clients for end-to-end testing in `internal/tools/e2e`.
- Enhanced logging and error handling throughout the codebase.
- Updated `.gitignore` to exclude build artifacts and temporary files.
* feat: add SSH and uTLS tun support in cli
feat: Implemented SSH connection management in ssh_conn.go, allowing for direct channel handling over SSH.
* feat: Implement URI handling with layered transport options
- Added `listener` struct to manage connections with URI layers.
- Introduced `Layers` and `Layer` types to support multiple connection layers.
- Implemented `Wrap` method for `Layers` to wrap connections with specified layers.
- Created `Scheme` type to encapsulate transport and layers for URIs.
- Defined `Transport` type with TCP and UDP options.
- Developed `URI` type to represent a URI with scheme and address.
- Implemented marshaling and unmarshaling for `Layers`, `Scheme`, `Transport`, and `URI`.
- Added support for various connection layers including SSH, TLS, DTLS, and PSK.
- Included error handling for invalid parameters and missing keys in layer configurations.
* fix: lint
* feat: Add JSON marshaling and unmarshaling for Layers and update URI and Scheme structs
* fix: Update parameter names and improve documentation in README and URI format
* fix: Update parameter names in README and URI format for consistency
Chains use the form `<chain>://host:port` where `<chain>` is a `+`-separated list starting with a base transport (`tcp` or `udp`), optionally followed by wrappers with parameters in brackets.
195
+
196
+
**Supported base transports:**
197
+
198
+
-`tcp` - TCP listener or dialer
199
+
-`udp` - UDP listener or dialer
200
+
201
+
**Supported wrappers:**
202
+
203
+
-`tls` - Transport Layer Security
204
+
- Server params: `cert`, `key`
205
+
- Client params: `cert` (optional, for SPKI pinning), `servername` (required if cert not provided)
206
+
207
+
-`utls` - TLS with client fingerprint camouflage via uTLS
208
+
- Client-side only
209
+
- Params: `cert` (optional, for SPKI pinning), `servername` (required if cert not provided), `hello` (optional: chrome, firefox, ios, android, safari, edge, randomized, randomizednoalpn; default: chrome)
210
+
211
+
-`dtls` - Datagram Transport Layer Security
212
+
- Server params: `cert`, `key`
213
+
- Client params: `cert` (optional, for SPKI pinning), `servername` (required if cert not provided)
214
+
215
+
-`tlspsk` - TLS with pre-shared key (TLS 1.2, cipher: TLS_PSK_WITH_AES_256_CBC_SHA)
216
+
- Params: `key`, `identity`
217
+
218
+
-`dtlspsk` - DTLS with pre-shared key (cipher: TLS_PSK_WITH_AES_128_GCM_SHA256)
219
+
- Params: `key`, `identity`
220
+
221
+
-`aesgcm` - AES-GCM encryption with passive IV exchange
-`buffered` - Buffered read/write for better performance
225
+
- Params: `size` (optional, default: 4096)
226
+
227
+
-`framed` - Length-prefixed frames for packet semantics over streams
228
+
- Params: `maxsize` (optional, default: 32768)
229
+
230
+
-`ssh` - SSH tunneling via "direct-tcpip" channels
231
+
- Server params: `key` (optional, required with pass), `pass` (optional), `pubkey` (optional, required if no pass)
232
+
- Client params: `pubkey`, `pass` (optional), `key` (optional, required if no pass)
233
+
234
+
**Notes:**
235
+
- All passwords, keys and certificates must be provided as hex-encoded strings.
236
+
- When using `cert` for client-side `tls`/`utls`/`dtls`, default validation is disabled and a manual SPKI (SubjectPublicKeyInfo) hash comparison is performed against the provided certificate. This is certificate pinning and will fail if the server presents a different key.
0 commit comments