example

command
v2.0.0-beta.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package main provides a simple example of using the tunnel package.

This example demonstrates: - Starting a Gateway server - Connecting an Agent to the Gateway - Registering services and proxying HTTP requests

Usage:

# Run all components together (gateway + agent + backend)
go run ./core/tunnel/example/main.go

# Run with different transport protocols
go run ./core/tunnel/example/main.go -transport=quic
go run ./core/tunnel/example/main.go -transport=kcp

# Run components separately (in different terminals)
go run ./core/tunnel/example/main.go -mode=backend
go run ./core/tunnel/example/main.go -mode=gateway
go run ./core/tunnel/example/main.go -mode=agent

# Verify request routing
curl http://127.0.0.1:18080/demo-svc/hello

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL