Прокси сервера для linux

Использование HTTP proxy и SOCKS в Linux

В Linux существует много полезных консольных команд, которые при необходимости хотелось бы запустить через proxy. Некоторые приложения имеют встроенную поддержку proxy, а некоторые нет. Далее описано как пользоваться востребованными утилитами через proxy, даже теми, которые этой поддержки не имеют.

curl: передача данных через proxy

curl имеет полноценную поддержку как HTTP proxy так и SOCKS.

Для тестирования возможно использовать proxy сервера из бесплатных списков (socks — sockslist.net, и HTTP proxy — proxyhttp.net). Проверка IP адреса будет производиться с помощью ресурса check-host.net

# Проверить HTTP proxy curl --proxy 11.22.33.44:5555 check-host.net/ip # Тоже самое, но если для HTTP proxy требуется авторизация curl --proxy 11.22.33.44:5555 -U username:password check-host.net/ip # Проверить socks4 curl --socks4 11.22.33.44:5555 check-host.net/ip # Проверить socks5 curl --socks5 11.22.33.44:5555 check-host.net/ip # Тоже самое, только преобразование имен идет также через SOCKS # (подробнее о преобразовании имен можно прочитать ниже в подразделе "DNS запросы через proxy") curl --socks5-hostname 11.22.33.44:5555 check-host.net/ip 

Часть параметров curl можно записать в файл ~/.curlrc:

socks5 = 11.22.33.44:5555 proxy-user = username:password user-agent = "Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1" 

С помощью time и curl также можно замерить время отклика сервера:

# Без proxy: time curl check-host.net/ip # С proxy: time curl --socks5 11.22.33.44:5555 check-host.net/ip # Или любого сайта: time curl habrahabr.ru 

Результат будет выглядеть так:

real 0m0.307s user 0m0.000s sys 0m0.004s 

wget: закачка файлов через proxy

wget имеет встроенную поддержку proxy. Недостаток лишь в том, что только поддержку HTTP proxy. Для использования совместно с SOCKS рекомендуется использовать соксификатор dante.

 # Скачать файл через proxy: http_proxy="http://33.22.44.44:8080" wget http://www.google.com/favicon.ico Тоже самое, но для HTTPS https_proxy="http://33.22.44.44:8080" wget https://www.google.com/favicon.ico # Использовать proxy с авторизацией http_proxy="http://33.22.44.44:8080" wget --proxy-user=user --proxy-password=password http://www.google.com/favicon.ico 

Чтобы все время не указывать —proxy-user и —proxy-password можно их прописать в файл ~/.wgetrc:

proxy-user = username proxy-password = password user-agent = Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20100101 Firefox/7.0.1 

ssh: доступ к серверам

Для доступа к серверам через ssh и proxy также лучше использовать соксификатор dante.

Соксификатор dante

apt-get install dante-client # пример для Debian-based систем 
# Если требуется зайти по ssh на сервер SOCKS_PASSWORD="" SOCKS_SERVER="11.22.33.44:1080" socksify ssh myserver # Тоже самое, только если для подключения к соксу требуется авторизация SOCKS_USERNAME="user" SOCKS_PASSWORD="password" SOCKS_SERVER="11.22.33.44:1080" socksify ssh myserver # Пример с использованием IRC клиента - irssi SOCKS_PASSWORD="" SOCKS_SERVER="11.22.33.44:1080" socksify irssi # Тоже самое, только с использованием HTTP proxy с поддержкой метода CONNECT HTTP_CONNECT_PROXY="http://11.22.33.44:8080" socksify irssi 

С помощью socksify можно направить через proxy почти любое приложение, не только консольное.

Чтобы все время не вводить данные о proxy можно создать файл /etc/socks.conf
Пример для SOCKS:

Пример для HTTP proxy с авторизацией:

А также экспортировать переменные SOCKS_USERNAME и SOCKS_PASSWORD, если для SOCKS или HTTP proxy требуется авторизация:

export SOCKS_USERNAME="username" export SOCKS_PASSWORD="password" 

DNS запросы через proxy

Часто требуется чтобы и преобразование имен происходило через proxy. Если использовать dante, то запрос на преобразование имен идет и через proxy, и через именной сервер указанный в /etc/resolv.conf . Понять почему же идет два одинаковых запроса вместо одного не удалось. Поэтому можно предложить два варианта:
1) Закомментировать именные сервера в файле /etc/resolv.conf, чтобы преобразование имен шло только через proxy. Это отразится на всей системе.
2) Изменить /etc/resolv.conf и выставить именные сервера необходимой страны, или просто отличные от серверов провайдера. Например установить сервера Google:

nameserver 8.8.8.8 nameserver 8.8.4.4 

Чтобы данные не были перезаписаны именными серверами провайдера (при переподключении), можно запретить обновление списка именных серверов сетевому менеджеру (NetworkManager/wicd) или DHCP-клиенту (спасибо ergil за корректировку).

Читайте также:  Astra linux настройка сети dns

Или воспользоваться «грубым» методом — запрещением изменения файла /etc/resolv.conf:

sudo chattr +i /etc/resolv.conf 

Если есть какие-то дополнения, пожалуйста, напишите, это будет полезно узнать и применить.

Источник

Best Linux Proxy Server

Best_Linux_Proxy_Server

Nowadays using a proxy server could be the must-have option. For the current year, I faced with two situations when the most popular resources were blocked and I’m talking about Telegram issues in Russia and blocked VK.com in Ukraine. My customer and friend contacted me and requested to solve this complex situation by installing a proxy server.
Let’s get some sort of knowledge about proxy servers and solutions. The most common reason for using a proxy is to hide your real IP and access resources that are blocked in your location. Another reason for using caching proxy servers could be a way to reduce the load on the network, increase throughput, save traffic, monitor the user activities, and even block unwanted sites. Another application of proxy server — websites used for caching of generated pages to speed up loading of sites.
In this article, I will show the best Linux proxy servers in the most popular variants that you can use in configuration.

Linux Proxy Servers

Squid

This is the best Linux proxy server supporting HTTP, HTTPS, FTP, and the rest of the protocols. It allows increase network bandwidth and reduces the time of site feedback by caching resources and pages. The pages and sites that are requested often could be used repeatedly. You can configure caching as in operative memory, so on the hard drive if needed to cache lots of data at slow Internet. Also, IP rotation could be implemented to have multiple outbound IPs when you surf the web.
Withal, Squid has extra wide opportunities of controlling the access to network resources. You can block not only the obvious queries to domains or certain file sizes upload, but also access to the network at a specific time, work of protocols and ports, and also many other things. Squid supports not exceptionally only Linux operating system, however, initially, it was not so.

Privoxy

This is another caching best Linux distro for proxy server, which is installed on the client side. It supports all major web protocols but is increasingly being used not for content caching, but for filtration and security of user privacy. Thanks to it, you can change web pages, cut out advertisements, control the cookies, limit access to several websites, also delete any objectionable content and manage the headings sent by the browser.
In contrast to Squid, the program is configured through a quite convenient web interface. Although, at certain points, you may be confused. Except of web interface, you can use the configuration file, but it is much more difficult.

Читайте также:  Network manager kali linux настройка

Polipo

It is a small, but fast caching Linux proxy server with open source software, which supports HTTP and DNS protocols. Polipo can be used for advertisement filtering, to increase privacy, or to speed up websites by using page caching. As well as Privoxy it is mainly intended to provide privacy. Program configuration is performed by a web interface, but besides itself, there are several graphical shells for interactivity with the program.

Tiny Proxy

Very simple and easy Linux proxy server with basic settings. It is created as a small and very fast proxy that supports HTTP and HTTPS. Despite the lightness of this server, Linux keeps all the necessary functions, such as remote access by using a web interface, based URL filtering of access to resources, and so on.

Exa Proxy

This one proxy is intended not for traffic caching, but for its modification that supports by convenient programming language via the HTTP protocol. All the HTTPS connections may be accessed without changing by using the Connect method. Linux proxy server works quickly and has a web interface to access of statistics of its work and settings.

Gate.js

It’s going to be something new and very interesting for you to know. This is a full-featured caching proxy server written with JavaScript using Node.js. Being created from scratch it’s intended to replace Squid and Nginx. You can cache the content that makes the work of web servers much easier, also speeding up a load of websites on the client side. The main feature is in scalability; since the program is written in an interpreted language, it can be easily expanded.

Artica Proxy

Is a powerful but easy though proxy server positioning itself as a complete replacement of the Squid. Program keep filtering of Internet and DNS queries traffic, protection from viruses and spam, creating caching rules, and authentication using the ACL lists.
Moreover, here you can find a very detailed statistics page by using which you can learn everything about the program work and network load.
[havequestion]

Best Linux Proxy Distros

CentOS

CentOS proxy server is a free version of the commercial Red Hat Enterprise Linux distro, developed by the community. They take the initial codes of Red Hat Enterprise Linux, clean it from branding, and organize the constant release of system updates. It is created with the idea to produce a stable and free OS for enterprises and organizations.
Features:

CentOS contains only the most stable releases of software packages. This has led to a greatly reduced risk of errors and failures.

Users who set up CentOS have access to corporate class security updates because this distribution is closely linked with Red Hat.

Includes a wide range of security features, including a powerful firewall and SELinux.

Ubuntu

This is the most popular and best Linux server distro. Even if it’s not at the top of the list among experienced users, the newcomers are definitely like it! This distribution is based on Debian and has a regular cycle of new version releases.
Features:

Читайте также:  Настройка интерфейса линукс минт

There is an easy and simple installer.

As the user interface is used Unity by default. It is kinda different from other OS desktop’s appearance, but won’t be very difficult to assimilate.

After the system is installed, you will get a wide range of software.

The popularity of Ubuntu caused a huge amount of software that suits perfectly; you can find it not only at official repositories but also at side PPA and on the Internet.

There is also a huge number of documentation and articles available on the Internet that describes how to configure a system. If you are facing any problem just try to look for a solution on the Internet and likely, you will find the answer.

Web Page Caching Servers

Varnish

In contrast to the above-mentioned programs, this proxy is designed greater for the work on the server side. It is intended to accelerate the websites with its modern architecture that gives significant productivity. Varnish cache saves web pages in memory of server for Apache or Nginx web server program would not generate it again. Web server only updates the pages when content is changing. Getting content from the memory is much faster than using full generating.

Ngnix

Everyone knows how great is this Linux file server distro, designed for operation under heavy load. But besides that, it can be used as a proxy server too. Ngnix can’t cache or filter the contents of pages, so his task is in accepting requests from clients on the server, transferring this data to other programs, and returning responses to the clients. Why is it beneficial to use? Because the program is optimized for maximum performance and can take simultaneously up to ten thousand requests from users.

Conclusion

In this article, we reviewed and described the best Linux proxy servers and maybe there are not all the programs that would be worth adding to the list. We hope that this information will be useful to you and if you have any questions concerning the mentioned topic, just contact ITsyndicate team to specify the details.

Set up the best proxy server entrusting the ITsyndicate experts

The most profitable solution – is to entrust the case to people who know how to accomplish the highest-level results. Firstly, it saves your time, and secondly, saves your money. Therefore, you get two for the price of one and at the same time get a respectable, desired, and excellent result from professionals. If setting up the best Linux proxy server of the latest updates is a difficult task for you, don’t worry. To carry these difficulties there is ITsyndicate team. By contacting us, you will get not only great quality of work but consultation on the questions that concern you. We are willing to help you at any time and make your proxy server the most productive and secure.

Источник

Оцените статью
Adblock
detector