Class NanoWSD
java.lang.Object
fi.iki.elonen.NanoHTTPD
fi.iki.elonen.NanoWSD
- Direct Known Subclasses:
DebugWebSocketServer
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic classstatic classstatic classNested classes/interfaces inherited from class NanoHTTPD
NanoHTTPD.AsyncRunner, NanoHTTPD.ClientHandler, NanoHTTPD.ContentType, NanoHTTPD.Cookie, NanoHTTPD.CookieHandler, NanoHTTPD.DefaultAsyncRunner, NanoHTTPD.DefaultServerSocketFactory, NanoHTTPD.DefaultTempFile, NanoHTTPD.DefaultTempFileManager, NanoHTTPD.HTTPSession, NanoHTTPD.IHTTPSession, NanoHTTPD.Method, NanoHTTPD.Response, NanoHTTPD.ResponseException, NanoHTTPD.SecureServerSocketFactory, NanoHTTPD.ServerRunnable, NanoHTTPD.ServerSocketFactory, NanoHTTPD.TempFile, NanoHTTPD.TempFileManager, NanoHTTPD.TempFileManagerFactory -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class NanoHTTPD
asyncRunner, MIME_HTML, MIME_PLAINTEXT, MIME_TYPES, SOCKET_READ_TIMEOUT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanstatic StringmakeAcceptKey(String key) protected abstract NanoWSD.WebSocketopenWebSocket(NanoHTTPD.IHTTPSession handshake) serve(NanoHTTPD.IHTTPSession session) Override this to customize the server.protected NanoHTTPD.ResponseserveHttp(NanoHTTPD.IHTTPSession session) protected booleannot all websockets implementations accept gzip compression.Methods inherited from class NanoHTTPD
closeAllConnections, createClientHandler, createServerRunnable, decodeParameters, decodeParameters, decodePercent, getHostname, getListeningPort, getMimeTypeForFile, getServerSocketFactory, getTempFileManagerFactory, isAlive, makeSecure, makeSSLSocketFactory, makeSSLSocketFactory, makeSSLSocketFactory, mimeTypes, newChunkedResponse, newFixedLengthResponse, newFixedLengthResponse, newFixedLengthResponse, serve, setAsyncRunner, setServerSocketFactory, setTempFileManagerFactory, start, start, start, stop, wasStarted
-
Field Details
-
HEADER_UPGRADE
- See Also:
-
HEADER_UPGRADE_VALUE
- See Also:
-
HEADER_CONNECTION
- See Also:
-
HEADER_CONNECTION_VALUE
- See Also:
-
HEADER_WEBSOCKET_VERSION
- See Also:
-
HEADER_WEBSOCKET_VERSION_VALUE
- See Also:
-
HEADER_WEBSOCKET_KEY
- See Also:
-
HEADER_WEBSOCKET_ACCEPT
- See Also:
-
HEADER_WEBSOCKET_PROTOCOL
- See Also:
-
-
Constructor Details
-
NanoWSD
public NanoWSD(int port) -
NanoWSD
-
-
Method Details
-
makeAcceptKey
- Throws:
NoSuchAlgorithmException
-
isWebsocketRequested
-
openWebSocket
-
serve
Description copied from class:NanoHTTPDOverride this to customize the server. (By default, this returns a 404 "Not Found" plain text error response.) -
serveHttp
-
useGzipWhenAccepted
not all websockets implementations accept gzip compression.- Overrides:
useGzipWhenAcceptedin classNanoHTTPD- Returns:
- true if the gzip compression should be used if the client accespts it. Default this option is on for text content and off for everything. Override this for custom semantics.
-