mirror of
https://github.com/thelounge/thelounge
synced 2024-11-22 20:13:07 +00:00
Merge pull request #1197 from thelounge/xpaw/socketio-transports
Correctly configure client socket transports
This commit is contained in:
commit
ca54c40d0f
3 changed files with 8 additions and 2 deletions
|
@ -25,7 +25,7 @@
|
|||
<meta name="theme-color" content="#455164">
|
||||
|
||||
</head>
|
||||
<body class="signed-out {{#if public}}public{{/if}}">
|
||||
<body class="signed-out {{#if public}}public{{/if}}" data-transports="{{tojson transports}}">
|
||||
|
||||
<div id="wrap">
|
||||
<div id="viewport">
|
||||
|
|
|
@ -5,6 +5,7 @@ const io = require("socket.io-client");
|
|||
const path = window.location.pathname + "socket.io/";
|
||||
|
||||
const socket = io({
|
||||
transports: $(document.body).data("transports"),
|
||||
path: path,
|
||||
autoConnect: false,
|
||||
reconnection: false
|
||||
|
|
|
@ -32,7 +32,12 @@ module.exports = function() {
|
|||
.use(allRequests)
|
||||
.use(index)
|
||||
.use(express.static("client"))
|
||||
.engine("html", expressHandlebars({extname: ".html"}))
|
||||
.engine("html", expressHandlebars({
|
||||
extname: ".html",
|
||||
helpers: {
|
||||
tojson: c => JSON.stringify(c)
|
||||
}
|
||||
}))
|
||||
.set("view engine", "html")
|
||||
.set("views", path.join(__dirname, "..", "client"));
|
||||
|
||||
|
|
Loading…
Reference in a new issue