LinuxCommandLibrary

frpc

Expose local services through a remote server

TLDR

Start the service, using the default configuration file (assumed to be frps.ini in the current directory)

$ frpc
copy

Start the service, using the newer TOML configuration file (frps.toml instead of frps.ini) in the current directory
$ frpc [[-c|--config]] ./frps.toml
copy

Start the service, using a specific configuration file
$ frpc [[-c|--config]] [path/to/file]
copy

Check if the configuration file is valid
$ frpc verify [[-c|--config]] [path/to/file]
copy

Print autocompletion setup script for Bash, fish, PowerShell, or Zsh
$ frpc completion [bash|fish|powershell|zsh]
copy

Display version
$ frpc [[-v|--version]]
copy

SYNOPSIS

frpc [global options] command [command options] [arguments...]

Common usage examples:
frpc start -c /path/to/frpc.ini
frpc -c /path/to/frpc.ini

PARAMETERS

-c <config_file>
    Specifies the path to the client configuration file (e.g., frpc.ini).

-t <token>
    Specifies the authentication token used to connect to the frps server. Can also be defined in the configuration file.

-l <log_file>
    Specifies the path where frpc will write its log messages.

-L <log_level>
    Sets the logging level. Common levels include info, warn, error, debug, and trace.

-p <profile_port>
    Specifies the pprof listening port for profiling and debugging frpc performance.

-v, --version
    Prints the version information of the frpc client.

--help
    Displays the help message, showing available commands and options.

start
    The primary command to start the frpc client and initiate proxy connections.

reload
    Reloads the client's configuration file without restarting the entire frpc process.

DESCRIPTION

frpc (FRP client) is the client-side executable of the open-source Fast Reverse Proxy project.
Its primary function is to expose local services, such as web servers, SSH, or game servers, that are behind a NAT or firewall, to the public internet.
It achieves this by establishing a persistent connection to an frps (FRP server) instance, which is typically hosted on a public server.
Through this established tunnel, frpc forwards incoming requests from the frps server to the designated local service and sends responses back.
This makes services accessible from outside the local network without requiring complex firewall configurations or public IP addresses for the local machine.
frpc supports various proxy types including TCP, UDP, HTTP, HTTPS, and SOCKS5, and offers features like domain-based routing, subdomain forwarding, and connection multiplexing, making it a versatile tool for remote access and service exposure.

CAVEATS

Security Risk: Exposing local services directly to the internet via frp requires careful consideration of security.
Ensure strong authentication tokens and proper network security measures.
Server Dependency: frpc requires a running frps server instance with public accessibility.
Performance: Performance can be limited by the bandwidth and latency of the frps server and the network path between client and server.
Configuration Complexity: Managing multiple proxy rules and advanced features can lead to complex configuration files.

<B>CONFIGURATION FILE</B>

The core of frpc operation relies on its configuration file, typically named frpc.ini.
This file defines the server connection details (e.g., server address, port, token) and all local services to be exposed, including their types (e.g., TCP, HTTP), local ports, and remote mappings.
It supports multiple proxy sections, allowing a single frpc instance to manage connections for various services simultaneously.

<B>PROXY TYPES</B>

frpc supports several proxy types, each tailored for different use cases:
TCP: For general-purpose TCP connections, like SSH or custom applications.
UDP: For UDP-based services, such as gaming or DNS.
HTTP/HTTPS: For exposing web services, with support for virtual hosts and subdomain routing.
SOCKS5: To establish a SOCKS5 proxy that can be used by any SOCKS5-compatible client to access the local network.

HISTORY

FRP, including the frpc client, is an open-source project initiated by Fatedier.
It quickly gained popularity in the developer community for its elegant solution to NAT traversal and remote access.
Since its inception, FRP has undergone continuous development, adding support for more proxy types, enhanced security features, and improved performance.
Its usage has grown significantly among users needing to bypass restrictive network environments to access their local services remotely.

SEE ALSO

frps(1) - FRP server component, ssh(1) - Secure Shell (can be used for port forwarding), nginx(8) - High-performance HTTP and reverse proxy server

Copied to clipboard