Allow localhost to connect to websocket
Summary: Accept websocket connections from any localhost origin, in addition to the existing chrome extensions support. Reviewed By: jknoxville Differential Revision: D20792131 fbshipit-source-id: d3991aa375bfb4e6f492c02dfab9bf72b1f8c412
This commit is contained in:
committed by
Facebook GitHub Bot
parent
83fd17898f
commit
36f1b0e9c2
@@ -159,7 +159,10 @@ class Server extends EventEmitter {
|
|||||||
req: IncomingMessage;
|
req: IncomingMessage;
|
||||||
secure: boolean;
|
secure: boolean;
|
||||||
}) => {
|
}) => {
|
||||||
return info.origin.startsWith('chrome-extension://');
|
return (
|
||||||
|
info.origin.startsWith('chrome-extension://') ||
|
||||||
|
info.origin.startsWith('localhost:')
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
wss.on('connection', (ws: WebSocket, message: any) => {
|
wss.on('connection', (ws: WebSocket, message: any) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user