Updated ws paths.

This commit is contained in:
Willem Cazander 2024-12-14 14:14:33 +01:00
parent ba534872b9
commit 13842c11fa
4 changed files with 14 additions and 16 deletions

View file

@ -80,7 +80,7 @@ public class NoStrClientTest {
react.fire(clientSlot, new No2AllActClientConnect());
});
OjwWireClientEndpoint clientEndpoint = new OjwWireClientEndpoint(new URI("ws://localhost:8080/event"));
OjwWireClientEndpoint clientEndpoint = new OjwWireClientEndpoint(new URI("ws://localhost:8080/ws/nostr"));
System.out.println("NoStrClient start");
react.fire(No2AllRtsClient.API, new No2AllActClient(clientEndpoint));

View file

@ -27,7 +27,7 @@ public class EventClient implements WireClientHandler {
public EventClient() throws URISyntaxException {
client = new WebSocketClient();
endpoint1 = new JettyWireClientEndpoint(new URI("ws://localhost:8080"), client);
endpoint1 = new JettyWireClientEndpoint(new URI("ws://localhost:8080/ws/text"), client);
}
public void start() throws Exception {

View file

@ -37,7 +37,6 @@ public class EventServer {
private final ServerConnector connector;
private JettyWireServerEndpoint endpoint1;
private JettyWireServerEndpoint endpoint2;
private JettyWireServerEndpoint endpoint3;
public EventServer() {
server = new Server();
@ -48,9 +47,8 @@ public class EventServer {
server.setHandler(context);
JettyWebSocketServletContainerInitializer.configure(context, (servletContext, wsContainer) -> {
wsContainer.setMaxTextMessageSize(65535);
endpoint1 = new JettyWireServerEndpoint(wsContainer, "/");
endpoint2 = new JettyWireServerEndpoint(wsContainer, "/event");
endpoint3 = new JettyWireServerEndpoint(wsContainer, "/other");
endpoint1 = new JettyWireServerEndpoint(wsContainer, "/ws/text");
endpoint2 = new JettyWireServerEndpoint(wsContainer, "/ws/bin");
});
server.addEventListener(new Listener() {
@ -74,7 +72,6 @@ public class EventServer {
});
react.fire(No2AllRtsServer.API, new No2AllActServer(endpoint1));
react.fire(No2AllRtsServer.API, new No2AllActServer(endpoint2));
react.fire(No2AllRtsServer.API, new No2AllActServer(endpoint3));
}
});
}

View file

@ -36,9 +36,9 @@ public final class ZFunRtsConfigJetty implements No2AllReactTypeScript {
private static final Logger logger = Logger.getLogger(ZFunRtsConfigJetty.class.getName());
private final Server server;
private final ServerConnector connector;
private JettyWireServerEndpoint endpoint1;
private JettyWireServerEndpoint endpoint2;
private JettyWireServerEndpoint endpoint3;
private JettyWireServerEndpoint wsNostr;
private JettyWireServerEndpoint wsHyper;
private JettyWireServerEndpoint wsNether;
public ZFunRtsConfigJetty(int port) {
server = new Server();
@ -64,12 +64,13 @@ public final class ZFunRtsConfigJetty implements No2AllReactTypeScript {
JettyWebSocketServletContainerInitializer.configure(context, (servletContext, wsContainer) -> {
wsContainer.setMaxTextMessageSize(65535);
endpoint1 = new JettyWireServerEndpoint(wsContainer, "/con1");
endpoint2 = new JettyWireServerEndpoint(wsContainer, "/event");
endpoint3 = new JettyWireServerEndpoint(wsContainer, "/other");
wsNostr = new JettyWireServerEndpoint(wsContainer, "/ws/nostr");
wsHyper = new JettyWireServerEndpoint(wsContainer, "/ws/hyper");
wsNether = new JettyWireServerEndpoint(wsContainer, "/ws/nether");
});
logger.info("Add H2 console on: /debug/jdbc/console");
// TODO: upgrade jetty, H2 has added "JakartaWebServlet"
context.addServlet("org.h2.server.web.WebServlet", "/debug/jdbc/console/*");
context.addServlet(RedirectServlet.class, "/test");
@ -87,9 +88,9 @@ public final class ZFunRtsConfigJetty implements No2AllReactTypeScript {
server.addEventListener(new Listener() {
@Override
public void lifeCycleStarted(LifeCycle event) {
react.fire(No2AllRtsServer.API, new No2AllActServer(endpoint1));
react.fire(No2AllRtsServer.API, new No2AllActServer(endpoint2));
react.fire(No2AllRtsServer.API, new No2AllActServer(endpoint3));
react.fire(No2AllRtsServer.API, new No2AllActServer(wsNostr)); // text
react.fire(No2AllRtsServer.API, new No2AllActServer(wsHyper)); // text + bin
react.fire(No2AllRtsServer.API, new No2AllActServer(wsNether)); // bin
}
});
try {