برای تنظیم پروکسی HTTP, HTTPS و SOCKS در سطح کل سیستم لینوکس از دو دستور زیر میتونید استفاده کنید
1 2 3 4 5 6 7 8 9 10 11 |
$ export http_proxy='http://username:password@proxy-server' $ export https_proxy='https://username:password@proxy-server' # to proxy https traffic $ or a socks proxy $ export http_proxy='socks://username:password@proxy-server' $ export https_proxy='socks://username:password@proxy-server' # to proxy https traffic $ myapp # or $ http_proxy='http://username:password@proxy-server' https_proxy='https://username:password@proxy-server' myapp # or $ env http_proxy='http://username:password@proxy-server' https_proxy='https://username:password@proxy-server' myapp |
- اگه پروکسی HTPS ندارید همون پروکسی HTTP رو واسه https_proxy وارد کنید
- آدرس میتونه با یا بدون کوتیشن باشه
- تقریبا تمامی برنامه مثل curl,git,urllib.. از دو متغیر بالا که با حروف کوچیک باشن استفاده میکنن بنابراین http_proxy و https_proxy رو با حروف کوچیک وارد کنید
و برای غیر فعال کردن هم
1 2 3 4 5 |
$ unset http_proxy $ unset https_proxy # or $ export http_proxy='' $ export https_proxy='' |
میتونید یک دستور میانبر هم واسش درست کنید
1 2 |
$ alias proxyon="export http_proxy='http://username:password@proxy-server';export https_proxy='http://username:password@proxy-server'" $ alias proxyoff="export http_proxy='';export https_proxy=''" |