how to use frp ?

FRP (Fast Reverse Proxy) is a high-performance, open-source reverse proxy application that can help you expose a local server behind a NAT or firewall to the internet. As with many such systems, FRP consists of a client and a server.

Here’s a simple guide on how to use FRP:

  1. Download FRP: Visit the FRP GitHub release page at https://github.com/fatedier/frp/releases, and download the latest release for your operating system.

  2. Prepare Your Server: You need a server with a public IP address to run the FRP server (frps). On your server, extract the downloaded package, and you’ll find two binaries, frps (FRP server) and frpc (FRP client).

  3. Configure the FRP Server:

    • In the extracted directory, you’ll find an example configuration file for the server named frps.ini. Adjust this file according to your needs.

    • A simple example for the frps.ini file could be:

      [common]
      bind_port = 7000
      

      This will run the FRP server on port 7000.

    • Start the FRP server by running: ./frps -c ./frps.ini

  4. Configure the FRP Client:

    • On your local machine (the one behind the NAT or firewall), extract the FRP binaries, and modify the frpc.ini file.

    • A simple example for the frpc.ini file could be:

      [common]
      server_addr = x.x.x.x
      server_port = 7000
      
      [web]
      type = http
      local_port = 80
      custom_domains = www.yourdomain.com
      

      Here, replace x.x.x.x with your server’s public IP address, and www.yourdomain.com with your domain (or subdomain) you want to use. local_port should be the port your local server is running on.

    • Start the FRP client by running: ./frpc -c ./frpc.ini

  5. Test It Out:

    • Now, if you access www.yourdomain.com (or whatever domain you set in custom_domains), you should be able to access your local server.

Remember, FRP supports many other features like TCP, UDP, STCP (Secure TCP), P2P connections, and more. Refer to the official documentation for more complex configurations and features: https://github.com/fatedier/frp.

Also, please consider using a process supervisor system to ensure that the FRP server and client are always running. Examples for these are systemd for Linux or supervisord for more general use.

Guess you like

Origin blog.csdn.net/m0_57236802/article/details/131997133