You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-1Lines changed: 8 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,10 +94,17 @@ There is a [simple file server](https://github.com/robaho/httpserver/blob/727759
94
94
gradle runSimpleFileServer
95
95
```
96
96
97
-
## Websockets
97
+
## websockets
98
98
99
99
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).
100
100
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
+
101
108
## logging
102
109
103
110
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