Documentation
¶
Overview ¶
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Copyright (C) 2026 by saba <contact me via issue>
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association with this application without prior consent.
Index ¶
- func HandleServerSession(conn net.Conn, userHash string, mgr *Manager, helloPayload []byte) error
- func ServeClientSession(conn net.Conn, clientID string, routes []config.ReverseRoute) error
- func ServeEntry(listenAddr string, mgr *Manager) error
- func ServeLocalWSForward(listenAddr, dialURL string, insecure bool) error
- type Manager
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HandleServerSession ¶
HandleServerSession handles a reverse client registration connection. helloPayload is the JSON payload from the control plane.
func ServeClientSession ¶
ServeClientSession registers routes to the server and serves reverse mux streams until the session ends.
func ServeEntry ¶
ServeEntry serves both:
- HTTP reverse proxy requests (path-based routing), and
- raw TCP reverse forwarding (requires a route with Path=="")
on the same TCP listen address. Incoming connections are sniffed by the first 4 bytes: if they look like a supported HTTP/1.x request method prefix, the connection is treated as HTTP; otherwise it is treated as raw TCP.
func ServeLocalWSForward ¶
ServeLocalWSForward listens on listenAddr and forwards each accepted TCP connection through a WebSocket tunnel at dialURL (ws:// or wss://). The WebSocket connection must negotiate the "sudoku-tcp-v1" subprotocol (see sudokuTCPSubprotocol).
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager() *Manager
func (*Manager) RegisterSession ¶
func (m *Manager) RegisterSession(clientID string, mux *tunnel.MuxClient, routes []config.ReverseRoute) error
RegisterSession registers a reverse client session and its routes.
On conflict (same path prefix already registered), it returns an error.
func (*Manager) ServeTCP ¶
ServeTCP handles a raw TCP connection by forwarding it through the reverse session.
It requires a reverse route with an empty path (Path=="") to be registered.