Protected socket.io connection with csrf-sync to prevent cross-site connections.
This commit is contained in:
parent
6c379321f7
commit
4a865e8aa8
3 changed files with 16 additions and 3 deletions
|
|
@ -35,7 +35,12 @@ class channel{
|
|||
}
|
||||
|
||||
connect(){
|
||||
this.socket = io();
|
||||
this.socket = io({
|
||||
extraHeaders: {
|
||||
//Include CSRF token
|
||||
'x-csrf-token': utils.ajax.getCSRFToken()
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
defineListeners(){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue