mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Forces socket io to use websocket instead of polling
SocketIO uses the last successful method of transport to communicate. But we have eventlet in our dependency which allows for websocket, and we ideally want communications to be over websocket. So specified the transport method as websocket in socket io connect.
This commit is contained in:
parent
b530eb3cea
commit
7ab10a0a57
@ -1,7 +1,12 @@
|
|||||||
$(function () {
|
$(function () {
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
$('.chat-container').removeClass('no-js');
|
$('.chat-container').removeClass('no-js');
|
||||||
var socket = io.connect('http://' + document.domain + ':' + location.port + '/chat');
|
var socket = io.connect(
|
||||||
|
'http://' + document.domain + ':' + location.port + '/chat',
|
||||||
|
{
|
||||||
|
transports: ['websocket']
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
// Store current username received from app context
|
// Store current username received from app context
|
||||||
var current_username = $('#username').val();
|
var current_username = $('#username').val();
|
||||||
|
Loading…
Reference in New Issue
Block a user