Skip to content

Commit 2c5da6e

Browse files
authored
Update README.md
1 parent bc8161b commit 2c5da6e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,17 @@ There is a [simple file server](https://github.com/robaho/httpserver/blob/727759
9494
gradle runSimpleFileServer
9595
```
9696

97-
## Websockets
97+
## websockets
9898

9999
For websocket usage, see the examples in the [websocket testing folder](https://github.com/robaho/httpserver/tree/main/src/test/java/robaho/net/httpserver/websockets).
100100

101+
In general, create a handler that extends WebSocketHandler, and add an endpoint for the handler:
102+
103+
```
104+
HttpHandler h = new EchoWebSocketHandler();
105+
HttpContext c = server.createContext(path, h);
106+
```
107+
101108
## logging
102109

103110
All logging is performed using the [Java System Logger](https://docs.oracle.com/en/java/javase/19/docs/api/java.base/java/lang/System.Logger.html)

0 commit comments

Comments
 (0)