Help us shape the future of Go! Take the 2026 Go Developer Survey

server

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	// contains filtered or unexported fields
}

func New

func New(addr, rpcPath string, rpcHandler http.Handler, allowedHosts []string) *Server

New builds an HTTP server that routes connect RPC requests under rpcPath to rpcHandler and serves the embedded React SPA for everything else. allowedHosts is the set of Host-header hostnames (no port) accepted for both request admission and CORS — the DNS-rebinding / cross-origin defense.

func (*Server) SetMCPHandler added in v1.8.0

func (s *Server) SetMCPHandler(h http.Handler)

SetMCPHandler mounts an MCP handler at /mcp (in-process). It is served behind the same Host-header allowlist and security middleware as everything else, plus an Origin guard, and without any permissive CORS.

func (*Server) Start

func (s *Server) Start() error

Jump to

Keyboard shortcuts

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