TinyProxy : Mise en place d'un proxy simple et rapide

From Deimos.fr / Bloc Notes Informatique
Jump to: navigation, search
TinyProxy

Software version 1.8.3
Operating System Debian 7
Website TinyProxy Website
Last Update 27/07/2012
Others

1 Introduction

TinyProxy est un proxy, tout comme Squid, mais qui se veut être léger. Je l'utilise au travail sur ma machine pour mettre toutes mes applications dessus. L'avantage est d'avoir la configuration du proxy pour wget, apt, etc... qui pointe en localhost. Ainsi dans la configuration de TinyProxy, il n'y a plus qu'à configurer le serveur Proxy sur lequel on veut taper pour que toute mes applications soient redirigées dessus sans avoir à les toucher au moindre changement :-)

2 Installation

Sur Debian :

Command aptitude
aptitude install tinyproxy

3 Configuration

Je vous passerais une explication sur toutes les lignes du fichier de configuration et vous montrerais celles que j'ai utilisées :

Configuration File /etc/tinyproxy.conf
[...]
#
# Port: Specify the port which tinyproxy will listen on.  Please note
# that should you choose to run on a port lower than 1024 you will need
# to start tinyproxy using root.
# Nous renseignons ici le port d'écoute de Tiny proxy
Port 3128#
# Listen: If you have multiple interfaces this allows you to bind to
# only one. If this is commented out, tinyproxy will bind to all
# interfaces present.
# L'ip sur laquelle il doit tourner
Listen 127.0.0.1[...]
#
# Upstream:
#
# Turns on upstream proxy support.
#
# The upstream rules allow you to selectively route upstream connections
# based on the host/domain of the site being accessed.
#
# For example:
#  # connection to test domain goes through testproxy
#  upstream testproxy:8008 ".test.domain.invalid"
#  upstream testproxy:8008 ".our_testbed.example.com"
#  upstream testproxy:8008 "192.168.128.0/255.255.254.0"
#
#  # no upstream proxy for internal websites and unqualified hosts
#  no upstream ".internal.example.com"
#  no upstream "www.example.com"
#  no upstream "10.0.0.0/8"
#  no upstream "192.168.0.0/255.255.254.0"
#  no upstream "."
#
#  # connection to these boxes go through their DMZ firewalls
#  upstream cust1_firewall:8008 "testbed_for_cust1"
#  upstream cust2_firewall:8008 "testbed_for_cust2"
#
#  # default upstream is internet firewall
#  upstream firewall.internal.example.com:80
#
# The LAST matching rule wins the route decision.  As you can see, you
# can use a host, or a domain:
#  name     matches host exactly
#  .name    matches any host in domain "name"
#  .        matches any host with no domain (in 'empty' domain)
#  IP/bits  matches network/mask
#  IP/mask  matches network/mask
# Le serveur proxy sur lequel il doit pointer (celui vers lequel vous configurez normalement vos applications)
Upstream proxy.deimos.fr:3128[...]
#
# Allow: Customization of authorization controls. If there are any
# access control keywords then the default action is to DENY. Otherwise,
# the default action is ALLOW.
#
# The order of the controls are important. All incoming connections are
# tested against the controls based on order.
# On autorise localhost
Allow 127.0.0.1

Il ne vous reste plus qu'à configurer vos applications pour qu'elles tournent dessus :-)