mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #2346 from overleaf/bg-remove-realtime-proxy-router
remove RealTimeProxyRouter GitOrigin-RevId: 28e85b251890fb97547db768af907f357ee545cb
This commit is contained in:
parent
4c56fd9f5d
commit
012bef257d
2 changed files with 0 additions and 44 deletions
|
@ -1,42 +0,0 @@
|
|||
/* eslint-disable
|
||||
max-len,
|
||||
*/
|
||||
// TODO: This file was created by bulk-decaffeinate.
|
||||
// Fix any style issues and re-enable lint.
|
||||
/*
|
||||
* decaffeinate suggestions:
|
||||
* DS102: Remove unnecessary code created because of implicit returns
|
||||
* 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
|
||||
})
|
||||
const wsProxy = httpProxy.createProxyServer({
|
||||
target: settings.apis.realTime.url.replace('http://', 'ws://'),
|
||||
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) =>
|
||||
proxy.web(req, res, next)
|
||||
)
|
||||
|
||||
return setTimeout(function() {
|
||||
const Server = require('../../infrastructure/Server')
|
||||
return Server.server.on('upgrade', (req, socket, head) =>
|
||||
wsProxy.ws(req, socket, head)
|
||||
)
|
||||
}, 0)
|
||||
}
|
||||
}
|
|
@ -35,7 +35,6 @@ const ChatController = require('./Features/Chat/ChatController')
|
|||
const BlogController = require('./Features/Blog/BlogController')
|
||||
const Modules = require('./infrastructure/Modules')
|
||||
const RateLimiterMiddleware = require('./Features/Security/RateLimiterMiddleware')
|
||||
const RealTimeProxyRouter = require('./Features/RealTimeProxy/RealTimeProxyRouter')
|
||||
const InactiveProjectController = require('./Features/InactiveData/InactiveProjectController')
|
||||
const ContactRouter = require('./Features/Contacts/ContactRouter')
|
||||
const ReferencesController = require('./Features/References/ReferencesController')
|
||||
|
@ -92,7 +91,6 @@ function initialize(webRouter, privateApiRouter, publicApiRouter) {
|
|||
UploadsRouter.apply(webRouter, privateApiRouter)
|
||||
PasswordResetRouter.apply(webRouter, privateApiRouter)
|
||||
StaticPagesRouter.apply(webRouter, privateApiRouter)
|
||||
RealTimeProxyRouter.apply(webRouter, privateApiRouter)
|
||||
ContactRouter.apply(webRouter, privateApiRouter)
|
||||
AnalyticsRouter.apply(webRouter, privateApiRouter, publicApiRouter)
|
||||
LinkedFilesRouter.apply(webRouter, privateApiRouter, publicApiRouter)
|
||||
|
|
Loading…
Reference in a new issue