mirror of
https://github.com/discountry/ritmex-bot.git
synced 2026-09-09 08:18:07 +00:00
13 lines
623 B
JavaScript
13 lines
623 B
JavaScript
// @ts-nocheck
|
|
// JavaScript sample Proxy with CORS support
|
|
// Save this in a file like cors.js and run with:
|
|
// node cors [port]
|
|
// It will listen for your requests on the port you pass in command line (or port 8080 by default)
|
|
import cors from 'cors-anywhere'; // npm install cors-anywhere
|
|
const port = (process.argv.length > 2) ? parseInt(process.argv[2]) : 8080; // if not provided from cli, default to 8080
|
|
cors.createServer({
|
|
// you can set origin, if needed by exchange
|
|
// setHeaders: { 'origin': 'https://www.bitmex.com' }
|
|
}).listen(port, 'localhost');
|
|
console.log('Running CORS Anywhere on localhost:' + port);
|