mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #1480 from sharelatex/bg-allow-separate-websocket-url
allow setting separate wsUrl for websockets GitOrigin-RevId: afd4f441397c6b4b402e342f1dec01c971847a0f
This commit is contained in:
parent
4840d9e9bd
commit
c51461da09
4 changed files with 7 additions and 1 deletions
|
@ -68,6 +68,7 @@ html(
|
|||
script.
|
||||
window.sharelatex = {
|
||||
siteUrl: '#{settings.siteUrl}',
|
||||
wsUrl: '#{settings.wsUrl}',
|
||||
jsPath: '#{jsPath}',
|
||||
sixpackDomain: '#{settings.sixpack.domain}'
|
||||
};
|
||||
|
|
|
@ -188,6 +188,9 @@ module.exports = settings =
|
|||
# that are sent out, generated links, etc.
|
||||
siteUrl : siteUrl = process.env['PUBLIC_URL'] or 'http://localhost:3000'
|
||||
|
||||
# Optional separate location for websocket connections, if unset defaults to siteUrl.
|
||||
wsUrl: process.env['WEBSOCKET_URL']
|
||||
|
||||
# cookie domain
|
||||
# use full domain for cookies to only be accessible from that domain,
|
||||
# replace subdomain with dot to have them accessible on all subdomains
|
||||
|
|
|
@ -185,6 +185,7 @@ define([
|
|||
|
||||
ide.validFileRegex = '^[^*/]*$' // Don't allow * and /
|
||||
|
||||
ide.wsUrl = window.sharelatex.wsUrl || null // websocket url (if defined)
|
||||
ide.project_id = $scope.project_id = window.project_id
|
||||
ide.$scope = $scope
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ define([], function() {
|
|||
constructor(ide, $scope) {
|
||||
this.ide = ide
|
||||
this.$scope = $scope
|
||||
this.wsUrl = ide.wsUrl || null // websocket url (if defined)
|
||||
if (typeof io === 'undefined' || io === null) {
|
||||
console.error(
|
||||
'Socket.io javascript not loaded. Please check that the real-time service is running and accessible.'
|
||||
|
@ -94,7 +95,7 @@ define([], function() {
|
|||
})
|
||||
|
||||
this.ide.socket = io.connect(
|
||||
null,
|
||||
this.wsUrl,
|
||||
{
|
||||
reconnect: false,
|
||||
'connect timeout': 30 * 1000,
|
||||
|
|
Loading…
Reference in a new issue