just a demo including padid in header
parent
95e8ae1900
commit
f52dea0e13
|
@ -219,7 +219,31 @@ const sendClientReady = (isReconnect, messageType) => {
|
|||
};
|
||||
|
||||
const handshake = () => {
|
||||
socket = pad.socket = socketio.connect(exports.baseURL, '/', {
|
||||
|
||||
var padId = document.location.pathname.substring(document.location.pathname.lastIndexOf("/") + 1);
|
||||
|
||||
// demo, needs refactor
|
||||
|
||||
socket = pad.socket = io({
|
||||
transportOptions: {
|
||||
polling: {
|
||||
extraHeaders: {
|
||||
'x-padId': padId
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
socket = pad.socket = socket.connect(url, {
|
||||
|
||||
handlePreflightRequest: function (req, res) {
|
||||
var headers = {
|
||||
'padId': "derp"
|
||||
};
|
||||
res.writeHead(200, headers);
|
||||
res.end();
|
||||
},
|
||||
|
||||
reconnectionAttempts: 5,
|
||||
reconnection: true,
|
||||
reconnectionDelay: 1000,
|
||||
|
|
Loading…
Reference in New Issue