mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-23 16:26:17 -04:00
implementing options to make PairDrop reachable on localhost only to prevent bypassing the proxy server on production
This commit is contained in:
parent
bac272c0f3
commit
58a32d43b3
3 changed files with 43 additions and 22 deletions
9
index.js
9
index.js
|
@ -54,7 +54,6 @@ const RateLimit = require('express-rate-limit');
|
|||
const http = require('http');
|
||||
|
||||
const app = express();
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
if (process.argv.includes('--rate-limit')) {
|
||||
const limiter = RateLimit({
|
||||
|
@ -83,7 +82,13 @@ app.get('/', (req, res) => {
|
|||
});
|
||||
|
||||
const server = http.createServer(app);
|
||||
server.listen(port);
|
||||
const port = process.env.PORT || 3000;
|
||||
|
||||
if (process.argv.includes('--localhost-only')) {
|
||||
server.listen(port, '127.0.0.1');
|
||||
} else {
|
||||
server.listen(port);
|
||||
}
|
||||
|
||||
const parser = require('ua-parser-js');
|
||||
const { uniqueNamesGenerator, animals, colors } = require('unique-names-generator');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue