Documentation
¶
Index ¶
- func NewHTTPHandlerStack(srv http.Handler, cors []string, vhosts []string) http.Handler
- func NewVHostHandler(vhosts []string, next http.Handler) http.Handler
- func RegisterApis(apis []rpc.API, modules []string, srv *rpc.Server, exposeAll bool) error
- func StartHTTPEndpoint(endpoint string, timeouts rpc.HTTPTimeouts, handler http.Handler) (*http.Server, net.Addr, error)
- type HttpConfig
- type HttpServer
- func (h *HttpServer) EnableRPC(apis []rpc.API, config HttpConfig) error
- func (h *HttpServer) EnableTLS(cert, key string)
- func (h *HttpServer) EnableWS(apis []rpc.API, config WsConfig, ctx context.Context) error
- func (h *HttpServer) ListenAddr() string
- func (h *HttpServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *HttpServer) SetListenAddr(host string, port int) error
- func (h *HttpServer) Start(ctx context.Context) error
- func (h *HttpServer) Stop()
- type IpcServer
- type WsConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTTPHandlerStack ¶
NewHTTPHandlerStack returns wrapped http-related handlers
func RegisterApis ¶
RegisterApis checks the given modules' availability, generates an allowlist based on the allowed modules, and then registers all of the APIs exposed by the services.
Types ¶
type HttpConfig ¶
type HttpConfig struct { Modules []string CorsAllowedOrigins []string Vhosts []string // contains filtered or unexported fields }
HttpConfig is the JSON-RPC/HTTP configuration.
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewHTTPServer ¶
func NewHTTPServer(timeouts rpc.HTTPTimeouts) *HttpServer
func (*HttpServer) EnableRPC ¶
func (h *HttpServer) EnableRPC(apis []rpc.API, config HttpConfig) error
EnableRPC turns on JSON-RPC over HTTP on the server.
func (*HttpServer) EnableTLS ¶
func (h *HttpServer) EnableTLS(cert, key string)
func (*HttpServer) ListenAddr ¶
func (h *HttpServer) ListenAddr() string
ListenAddr returns the listening address of the server.
func (*HttpServer) ServeHTTP ¶
func (h *HttpServer) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*HttpServer) SetListenAddr ¶
func (h *HttpServer) SetListenAddr(host string, port int) error
SetListenAddr configures the listening address of the server. The address can only be set while the server isn't running.
Click to show internal directories.
Click to hide internal directories.