Documentation
¶
Index ¶
Constants ¶
const ( HostsHeader = "# GoRoute AgentBridge DNS Interception Begin" )
Variables ¶
var AgentBridgeTargets = map[string][]string{
"antigravity": {
"daily-cloudcode-pa.googleapis.com",
"cloudcode-pa.googleapis.com",
"daily-cloudcode-pa.sandbox.googleapis.com",
"autopush-cloudcode-pa.sandbox.googleapis.com",
},
"copilot": {
"api.githubcopilot.com",
"copilot-proxy.githubusercontent.com",
},
"claude-code": {
"api.anthropic.com",
},
"cursor": {
"api2.cursor.sh",
},
"codex": {
"api.openai.com",
},
}
AgentBridgeTargets maps tools to their default API endpoints that can be intercepted via /etc/hosts or DNS.
var InterceptedHosts = map[string]string{
"api.anthropic.com": "anthropic",
"api.openai.com": "openai",
"api.githubcopilot.com": "copilot",
"copilot-proxy.githubusercontent.com": "copilot",
"cloudcode-pa.googleapis.com": "antigravity",
}
Functions ¶
func GenerateHostsEntries ¶
GenerateHostsEntries generates hosts file content mapping targets to 127.0.0.1.
func ParseManagedHosts ¶
ParseHostsLines returns all hosts currently managed by GoRoute in the given hosts file.
func UpdateHostsContent ¶
UpdateHostsContent adds or updates GoRoute entries in a raw hosts file content.
Types ¶
type TargetHost ¶
type TunnelServer ¶
type TunnelServer struct {
// contains filtered or unexported fields
}
func NewTunnelServer ¶
func NewTunnelServer(routerAddr string) (*TunnelServer, error)
func (*TunnelServer) HandleConnect ¶
func (ts *TunnelServer) HandleConnect(w http.ResponseWriter, r *http.Request)
HandleConnect implements RFC 2817 HTTP CONNECT tunneling and transparent forwarding