overleaf/services/web/app/coffee/Features/RealTimeProxy/RealTimeProxyRouter.coffee

12 lines
No EOL
276 B
CoffeeScript

settings = require "settings-sharelatex"
httpProxy = require('http-proxy');
proxy = httpProxy.createProxyServer({
target: settings.apis.realTime.url
ws: true
})
module.exports =
apply: (app) ->
app.all /\/socket\.io\/.*/, (req, res, next) ->
proxy.web req, res, next