mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-02-01 03:12:42 +01:00
just a demo including padid in header
This commit is contained in:
parent
95e8ae1900
commit
f52dea0e13
1 changed files with 25 additions and 1 deletions
|
@ -219,7 +219,31 @@ const sendClientReady = (isReconnect, messageType) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const handshake = () => {
|
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,
|
reconnectionAttempts: 5,
|
||||||
reconnection: true,
|
reconnection: true,
|
||||||
reconnectionDelay: 1000,
|
reconnectionDelay: 1000,
|
||||||
|
|
Loading…
Reference in a new issue