aboutsummaryrefslogtreecommitdiffstats
path: root/src/cors-proxy.js
diff options
context:
space:
mode:
authors-ol <s-ol@users.noreply.github.com>2021-02-06 11:46:13 +0000
committers-ol <s-ol@users.noreply.github.com>2021-02-07 12:06:24 +0000
commit09c3c35c3302f1134cb404a2b7aad2aa7eb3792b (patch)
treec094a4033163f96bb454f38e6ef78ea7d1527ee3 /src/cors-proxy.js
parentfactor out Discussion component (diff)
downloadfedidag-09c3c35c3302f1134cb404a2b7aad2aa7eb3792b.tar.gz
fedidag-09c3c35c3302f1134cb404a2b7aad2aa7eb3792b.zip
Mastodon semi-compatibility
Diffstat (limited to 'src/cors-proxy.js')
-rw-r--r--src/cors-proxy.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cors-proxy.js b/src/cors-proxy.js
new file mode 100644
index 0000000..905eb0f
--- /dev/null
+++ b/src/cors-proxy.js
@@ -0,0 +1,12 @@
+var host = process.env.HOST || '127.0.0.1';
+var port = process.env.PORT || 8088;
+
+var cors_proxy = require('cors-anywhere');
+cors_proxy.createServer({
+ originWhitelist: [], // Allow all origins
+ requireHeader: ['origin', 'x-requested-with'],
+ removeHeaders: ['cookie', 'cookie2'],
+ checkRateLimit: null,
+}).listen(port, host, function() {
+ console.log('Running CORS Anywhere on ' + host + ':' + port);
+});