File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/@types/synchronizers/synchronizer-ws-server Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 683683 * // On the server:
684684 * const webSocketServer = new WebSocketServer({port: 8047});
685685 * webSocketServer.on('connection', (_, request) => {
686- * console.log('Client address: ' + request.socket.remoteAddress);
686+ * const clientAddress = request.socket.remoteAddress;
687+ * if (clientAddress == '::1' || clientAddress == '::ffff:127.0.0.1') {
688+ * console.log('Local client connected');
689+ * }
687690 * });
688691 * const server = createWsServer(webSocketServer);
689692 *
692695 * createMergeableStore(),
693696 * new WebSocket('ws://localhost:8047'),
694697 * );
695- * // -> 'Client address: ::1 '
698+ * // -> 'Local client connected '
696699 *
697700 * synchronizer.destroy();
698701 * server.destroy();
You can’t perform that action at this time.
0 commit comments