aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/proxy.ts
diff options
context:
space:
mode:
authorsmilekison <24309222+smilekison@users.noreply.github.com>2021-08-25 06:08:37 -0700
committerGitHub <noreply@github.com>2021-08-25 15:08:37 +0200
commit8729a87024fc837f7dd6f13afeec90cf6dda1c06 (patch)
tree0f6f34966cf7b08d3024a08def4aa547d3aec459 /server/helpers/proxy.ts
parentfdec51e3846d50e3375612a6820ed3ab0b5fcd25 (diff)
downloadPeerTube-8729a87024fc837f7dd6f13afeec90cf6dda1c06.tar.gz
PeerTube-8729a87024fc837f7dd6f13afeec90cf6dda1c06.tar.zst
PeerTube-8729a87024fc837f7dd6f13afeec90cf6dda1c06.zip
Support proxies for PeerTube (#4346)
* Updated with latest code * Updated Support proxies for PeerTube * Support Proxies for PeerTube (Updated with change request) * Cleanup proxy PR Co-authored-by: Chocobozzz <me@florianbigard.com>
Diffstat (limited to 'server/helpers/proxy.ts')
-rw-r--r--server/helpers/proxy.ts14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/helpers/proxy.ts b/server/helpers/proxy.ts
new file mode 100644
index 000000000..8b82ccae0
--- /dev/null
+++ b/server/helpers/proxy.ts
@@ -0,0 +1,14 @@
1function getProxy () {
2 return process.env.HTTPS_PROXY ||
3 process.env.HTTP_PROXY ||
4 undefined
5}
6
7function isProxyEnabled () {
8 return !!getProxy()
9}
10
11export {
12 getProxy,
13 isProxyEnabled
14}