# FRP (Fast Reverse Proxy)
### 🌐 Mettre en place un tunnel FRP #### 🧭 Objectif Configurer un tunnel sĂ©curisĂ© entre :
- đŸ« **Serveur distant (ex : Ă©cole)** inaccessible de l’extĂ©rieur - 🏠 **Serveur personnel (chez vous)** accessible via Internet
Le but est d’exposer un service local (ex : un site en localhost sur le port 3000) du serveur Ă©cole via un domaine (ex : `mondomaine.fr`) en passant par le serveur personnel.
---
#### đŸ“„ Étape 1 — TĂ©lĂ©charger FRP Rendez-vous sur : [https://github.com/fatedier/frp/releases](https://github.com/fatedier/frp/releases) TĂ©lĂ©chargez la derniĂšre version pour Linux (ex : `frp_0.62.0_linux_amd64.tar.gz`). DĂ©compressez sur chaque machine : ```bash tar -xvzf frp_0.62.0_linux_amd64.tar.gz cd frp_0.62.0_linux_amd64 ```
--- #### 🏠 Étape 2 — Configurer le serveur FRP (`frps`) sur le **serveur personnel** CrĂ©ez le fichier `frps.toml` : ```bash [common] bind_port = 7000 vhost_http_port = 8080 dashboard_port = 7500 dashboard_user = "admin" dashboard_pwd = "admin" authentication_method = "token" token = "votreTokenSecret" ``` ##### Lancer le serveur FRP : ```bash ./frps -c frps.toml ``` ##### (Optionnel) Lancer via PM2 : ```bash pm2 start ./frps --name frps -- -c ./frps.toml pm2 save pm2 startup ``` --- #### đŸ« Étape 3 — Configurer le client FRP (`frpc`) sur le **serveur distant** CrĂ©ez le fichier `frpc.toml` : ```bash [common] server_addr = "IP_DU_SERVEUR_PERSONNEL" server_port = 7000 authentication_method = "token" token = "votreTokenSecret" [appweb] type = "http" local_port = 3000 custom_domains = "mondomaine.fr" ``` ##### Lancer le client : ```bash ./frpc -c frpc.toml ``` ##### (Optionnel) Lancer via PM2 : ```bash pm2 start ./frpc --name frpc -- -c ./frpc.toml pm2 save pm2 startup ``` --- ## 🌍 Étape 4 — Configurer le DNS Ajoutez un enregistrement DNS :
TypeNomValeurProxy
Amondomaine.frIP\_DU\_SERVEUR\_PERSONNEL✅ activĂ©
--- #### 🌐 Étape 5 — (Optionnel) Reverse proxy avec Caddy Si vous utilisez **Caddy** sur le serveur personnel : ``` mondomaine.fr { reverse_proxy localhost:8080 { } } ``` ##### Recharger Caddy : ```bash sudo systemctl reload caddy ``` --- #### đŸ§Ș VĂ©rification 1. AccĂ©dez Ă  `https://mondomaine.fr` 2. Visitez le dashboard FRP (si activĂ©) : `http://IP:7500` 3. Consultez les logs avec `pm2 logs frps` ou `frpc` --- #### ✅ RĂ©sumĂ© - 🔐 Connexion sortante seulement depuis le serveur distant - 🌍 Tunnel HTTP sĂ©curisĂ© entre deux machines - 🔁 Service redirigĂ© automatiquement depuis un domaine public --- #### 📚 Liens utiles - Documentation officielle : [https://gofrp.org/en/](https://gofrp.org/en/) - GitHub : [https://github.com/fatedier/frp](https://github.com/fatedier/frp)