Documentation
¶
Index ¶
- type HttpExchange
- func (e *HttpExchange) Close()
- func (e *HttpExchange) GetRequestBody() jrt.InputStream
- func (e *HttpExchange) GetRequestMethod() string
- func (e *HttpExchange) GetRequestURI() *jrt.URI
- func (e *HttpExchange) GetResponseBody() jrt.OutputStream
- func (e *HttpExchange) GetResponseHeaders() *HttpHeaders
- func (e *HttpExchange) SendResponseHeaders(code int32, length int64)
- type HttpHeaders
- type HttpServer
- type InetAddress
- type InetSocketAddress
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HttpExchange ¶
type HttpExchange struct {
// contains filtered or unexported fields
}
HttpExchange is one request being answered; SendResponseHeaders(code, length) with length -1 means no body.
func (*HttpExchange) Close ¶
func (e *HttpExchange) Close()
Close ends the exchange: the handler's return does that anyway. Closing before any header was sent drops the connection, as the JDK server does; a writer that cannot hijack gets an empty 200 instead.
func (*HttpExchange) GetRequestBody ¶
func (e *HttpExchange) GetRequestBody() jrt.InputStream
func (*HttpExchange) GetRequestMethod ¶
func (e *HttpExchange) GetRequestMethod() string
func (*HttpExchange) GetRequestURI ¶
func (e *HttpExchange) GetRequestURI() *jrt.URI
func (*HttpExchange) GetResponseBody ¶
func (e *HttpExchange) GetResponseBody() jrt.OutputStream
func (*HttpExchange) GetResponseHeaders ¶
func (e *HttpExchange) GetResponseHeaders() *HttpHeaders
func (*HttpExchange) SendResponseHeaders ¶
func (e *HttpExchange) SendResponseHeaders(code int32, length int64)
type HttpHeaders ¶
type HttpHeaders struct {
// contains filtered or unexported fields
}
func (*HttpHeaders) Set ¶
func (h *HttpHeaders) Set(k, v string)
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
HttpServer is com.sun.net.httpserver.HttpServer on a loopback listener.
func HttpServerCreate ¶
func HttpServerCreate(addr *InetSocketAddress, _ int32) *HttpServer
func (*HttpServer) CreateContext ¶
func (s *HttpServer) CreateContext(path string, h func(*HttpExchange))
func (*HttpServer) GetAddress ¶
func (s *HttpServer) GetAddress() *InetSocketAddress
func (*HttpServer) Start ¶
func (s *HttpServer) Start()
func (*HttpServer) Stop ¶
func (s *HttpServer) Stop(delay int32)
type InetAddress ¶
type InetAddress struct {
// contains filtered or unexported fields
}
func InetAddressGetLoopbackAddress ¶
func InetAddressGetLoopbackAddress() *InetAddress
type InetSocketAddress ¶
type InetSocketAddress struct {
// contains filtered or unexported fields
}
func NewInetSocketAddress ¶
func NewInetSocketAddress(addr *InetAddress, port int32) *InetSocketAddress
func (*InetSocketAddress) GetPort ¶
func (a *InetSocketAddress) GetPort() int32