mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 23:53:29 +02:00
Rename "roles" to "units". Put units in their own folders.
This commit is contained in:
9
lib/units/websocket/middleware/remote-ip.js
Normal file
9
lib/units/websocket/middleware/remote-ip.js
Normal file
@@ -0,0 +1,9 @@
|
||||
var proxyaddr = require('proxy-addr')
|
||||
|
||||
module.exports = function(options) {
|
||||
return function(socket, next) {
|
||||
var req = socket.request
|
||||
req.ip = proxyaddr(req, options.trust)
|
||||
next()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user