|
|
@@ -9,7 +9,7 @@
|
|
|
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
|
|
|
*/
|
|
|
const settings = require('settings-sharelatex')
|
|
|
-
|
|
|
+const logger = require('logger-sharelatex')
|
|
|
const httpProxy = require('http-proxy')
|
|
|
const proxy = httpProxy.createProxyServer({
|
|
|
target: settings.apis.realTime.url
|
|
|
@@ -19,6 +19,13 @@ const wsProxy = httpProxy.createProxyServer({
|
|
|
ws: true
|
|
|
})
|
|
|
|
|
|
+proxy.on('error', function(error) {
|
|
|
+ logger.err({ proxyError: error }, 'realtime http proxy error')
|
|
|
+})
|
|
|
+wsProxy.on('error', function(error) {
|
|
|
+ logger.err({ proxyError: error }, 'realtime ws proxy error')
|
|
|
+})
|
|
|
+
|
|
|
module.exports = {
|
|
|
apply(webRouter, apiRouter) {
|
|
|
webRouter.all(/\/socket\.io\/.*/, (req, res, next) =>
|