Closed ysair closed 1 month ago
Parameters cannot be passed during a WebSocket connection. for example(javascript):
let socket = new WebSocket("ws://" + serverIp + ":" + serverPort + "/baseuri?param1=123", "protocol1");
At this time, the baseuri cannot be matched.
After modification, it can: Server.Settings.OnClientConnected := OnClientConnected;
procedure TServer.OnClientConnected(Sender: TObject); var proc : TWebSocketProcessServer; socket : TWebSocketServerSocket; begin proc := Sender as TWebSocketProcessServer; socket := proc.Socket as TWebSocketServerSocket; //parse parameters: socket.url = /baseuri?param1=123 end;
Parameters cannot be passed during a WebSocket connection. for example(javascript):
let socket = new WebSocket("ws://" + serverIp + ":" + serverPort + "/baseuri?param1=123", "protocol1");
At this time, the baseuri cannot be matched.
After modification, it can: Server.Settings.OnClientConnected := OnClientConnected;
procedure TServer.OnClientConnected(Sender: TObject); var proc : TWebSocketProcessServer; socket : TWebSocketServerSocket; begin proc := Sender as TWebSocketProcessServer; socket := proc.Socket as TWebSocketServerSocket; //parse parameters: socket.url = /baseuri?param1=123 end;