|
@@ -15,7 +15,8 @@ function ExpressPeerServer(server, options) {
|
|
|
key: 'peerjs',
|
|
|
ip_limit: 5000,
|
|
|
concurrent_limit: 5000,
|
|
|
- allow_discovery: false
|
|
|
+ allow_discovery: false,
|
|
|
+ proxied: false
|
|
|
}, options);
|
|
|
|
|
|
// Connected clients
|
|
@@ -27,6 +28,10 @@ function ExpressPeerServer(server, options) {
|
|
|
// Mark concurrent users per ip
|
|
|
app._ips = {};
|
|
|
|
|
|
+ if (options.proxied) {
|
|
|
+ app.set('trust proxy', options.proxied);
|
|
|
+ }
|
|
|
+
|
|
|
app.on('mount', function() {
|
|
|
if (!server) {
|
|
|
throw new Error('Server is not passed to constructor - '+
|