King Zone - frp
type: channel
link: https://www.kingtam.win/tag/frp/
items: Automatically deploy FRP server and client services using Docker via bash script
items: Use Docker to Deploy FRP Services
items: Let NPM and FRP share 80/443 ports with Wildcard Domain Name
items: 入坑IMTNAS星際魔盒2 - MCS7配置免費內網穿透frp

Automatically deploy FRP server and client services using Docker via bash script
type: item
date: 2023-03-21T15:05:00+08:00
description: Automatically deploy FRP server and client services using DockerAutomatically deploy fast reverse proxy server and client services using Docker.pngIt is an easy way to deploy FRP server and client services using Docker, which simplifies the setup process by breaking it down into four parts.Breakdown of contentPart1, Menu Settings function display_menu { echo "Please select a service as you want to deploy:" echo "1. FRP(S) Service" echo "2. FRP(C) Service" echo "0. Exit" }2023-03-21_120127.pngThe script starts with a menu that presents the user with three options to choose from. This menu is essential to guide the user through the rest of the process.Part2, FRP Server service deploy function handle_option_1 { }This part sets up the FRP server service as a function.include the followingif ! command -v docker &> /dev/null then echo "Docker is not installed. Installing Docker now..." curl -O https://kingtam.win/usr/uploads/script/install-docker.sh && chmod +x install-docker.sh && ./install-docker.sh fiIt detects if Docker is installed and if not, installs it.echo "What port would you like to use for the frps service? Press enter to use the default port of 7000, type 'r' to generate a random port, or enter a port number:" read -r port_choice if [[ $port_choice == "r" ]]; then port=$(shuf -i 7001-9000 -n 1) elif [[ -z $port_choice ]]; then port=7000 else port=$port_choice fi echo "What port would you like to use for the HTTP service? Press enter to use the default port of 80, or enter a port number:" read -r http_choice if [[ -z $http_choice ]]; then http=80 else http=$http_choice fi echo "What port would you like to use for the HTTPS service? Press enter to use the default port of 443, or enter a port number:" read -r https_choice if [[ -z $https_choice ]]; then https=443 else https=$https_choice fi echo "Would you like to generate a random token or enter a password for the frps service? Press enter to generate a random token, or enter a password:" read -r token_choice i…

Use Docker to Deploy FRP Services
type: item
date: 2023-03-09T15:07:00+08:00
description: Use Docker to deploy FRP services.drawio.pngAbout FRPFRP standard for fast reverse proxy, is an open-source, concise and easy-to-use, high-performance reverse proxy software, supporting TCP, UDP, HTTP, HTTPS and other protocols.Table of ContentsRequirementHow it WorkDeploy FRP servicesServer configurationClient configurationConclusionReferenceRequirementMust have a server with an Public IP address (e.g. VPC).How it workarchitecture.pngThe server runs, listens on a main port (default 7000), and waits for the client to connect;The client connects to the main port of the server, and tells the server the port and forwarding type to listen on.The server open new process session to listen on the specified port by the client;Users on the Internet connects to the specified port by the client, and the server forwards data to the client through the connection with the client.The client forwards the data to the local service, make the internal services expose to the Public Network.Deploy FRP servicesThe configuration tutorial is mainly divided into two partsOne is the configuration of the server (Internet)One is the configuration of the client (Intranet)Server configurationCreate a frps.ini configuration file on Server[common] bind_addr = 0.0.0.0 bind_port = 7000 vhost_http_port = 80 vhost_https_port = 443 log_file = /tmp/frps.log authentication_method = token token = yM1nDMBFihB93zs376uRParameterDescriptionbind_addr0.0.0.0 means listen on any IP addressbind_portDefault port 7000 is used to bind with the servervhost_http_portVirtual host HTTP portvhost_https_portVirtual host HTTPS portlog_file/tmp/frps.log logFile pathauthentication_methodSpecifies authentication method (e.g. token)tokenAuthentication token is yM1nDMBFihB93zs376uRFull configuration file for frps (Server)Use Docker Compose to Build the frps serviceversion: '3' services: frps: image: snowdreamtech/frps:latest container_name: frps network_mode: host restart: always volumes: - ./frps.ini:/etc/frp/frps.ini - ./tmp:…

Let NPM and FRP share 80/443 ports with Wildcard Domain Name
type: item
date: 2023-03-07T08:08:00+08:00
description: 2023-03-06_165215.pngPreface:Let NPM (Nginx Proxy Manager) and FRP (Fast Reverse Proxy) share 80/443 ports with wildcard domain nameConfiguration:frps.ini configsince NPM occupies port 80/443, and then in frps.ini please replace with a different port. such as: 1080/1443[common] bind_addr = 0.0.0.0 bind_port = 17000 vhost_http_port = 1080 vhost_https_port = 1443 # dashboard TLS mode dashboard_tls_mode = false authentication_method = token authenticate_heartbeats = false authenticate_new_work_conns = false token = yM1nDMBFihB93zs376uR # pool_count in each proxy will change to max_pool_count if they exceed the maximum value max_pool_count = 5 # max ports can be used for each client, default value is 0 means no limit max_ports_per_client = 0 # tls_only specifies whether to only accept TLS-encrypted connections. By default, the value is false. tls_only = false # if subdomain_host is not empty, you can set subdomain when type is http or https in frpc's configure file subdomain_host = kingtam.win # Enable golang pprof handlers in dashboard listener. # Dashboard port must be set first pprof_enable = false frpc.ini configIf Wildcard Domain Name is configured, then the Domain Name parameter in Fill in only the second-level domain name header. e.g. subdomain = navi[common] server_addr = frps.kingtam.win server_port = 17000 token = yM1nDMBFihB93zs376uR pool_count = 5 tcp_mux = true user = OneCloud login_fail_exit = false protocol = tcp tls_enable = true [navi] type = http subdomain = navi local_ip = 127.0.0.1 local_port = 5005Moreover, If Wildcard Domain Name is not configured, then the Domain Name parameter in Requires a complete domain name. e.g. custom_domains = navi.kingtam.win instead of subdomain = naviDNS management for Wildcard Domain Name (kingtam.win)image-20230307120041855.pngNPM configNPM reverse FRPS port 1080 to HTTPS with wildcard domain (*.kingtam.win)image-20230306164838962.pngimage-20230306164323507.pngproxy_pass http://127.0.0.1:1080; , written as .HTTP Never…

入坑IMTNAS星際魔盒2 - MCS7配置免費內網穿透frp
type: item
date: 2021-05-18T08:59:00+08:00
description: 入坑IMTNAS星際魔盒2 - MCS7配置免費內網穿透frp[shadow]MCS7_frp_01.png[/shadow]簡言:在IPV4地址短缺的情況之下，不是每個家庭都分配到公網的IPV4地址。如要訪問家中的設備就變得不方便，坊間有五花八門方法可以實現訪問家中設備，如TeamViewer、 Zero-Tier、 花生殼 等等， 但因為每地區的網絡環境不同，體驗也不一樣。 這裡我推薦frp實現家中設備在內網穿透到網外。為什麼是frp:frp 是一個高性能的反向代理應用，可以幫助您輕鬆地進行內網穿透，對外網提供服務，支持 tcp, http, https 等協議類型，並且 web 服務支持根據域名進行路由轉發。MCS7_frp_02.png配置前準備:申請域名1個, 無論是付費還是免費的(如果沒有, 可以購買一個也很便宜)DNSPod 域名MCS7_frp_03.pngMCS7_frp_04.png華為雲 域名MCS7_frp_05.png以CloudFlare設定為例:我的域名是: kingsir.ga想新增一個別名稱為imtnas給魔盒做訪問MCS7_frp_06.png[tip]選取: DNS記錄類型為: CNAME名稱: imtnas 目標: free.frp.ioiox.com[/tip]目標: free.frp.ioiox.com 是免費的frp服務器MCS7_frp_07.png等片刻，PING一下，兩個地址是否一樣.安裝frpc(即frpc客戶端):首先SSH登陸星際魔盒及獲得root權限MCS7_frp_08.png用戶名: admin密碼: adminsudo -iMCS7_frp_09.png下載及安裝frp客戶端(ARMV7):FRP_VERSION="0.36.2" && wget https://github.com/fatedier/frp/releases/download/v${FRP_VERSION}/frp_${FRP_VERSION}_linux_arm.tar.gz && tar -zxvf frp_${FRP_VERSION}_linux_arm.tar.gz && mv frp_${FRP_VERSION}_linux_arm/frpc /usr/local/bin && rm frp_${FRP_VERSION}_linux_arm.tar.gz && rm -rf frp_${FRP_VERSION}_linux_arm建立一個空白的資料夾 (存放frpc 配置文件):mkdir -p /etc/frpMCS7_frp_10.png創建frpc 配置文件:cat >> /etc/frp/frpc.ini << EOF [common] server_addr = free.frp.ioiox.com server_port = 7007 token = www.ioiox.com admin_addr = 10.10.1.51 admin_port = 7400 admin_user = admin admin_pwd = admin [imtnas] type = http local_ip = 10.10.1.51 local_port = 8060 custom_domains = imtnas.kingsir.ga EOF配置文件說明:admin_addr = 10.10.1.51 # 坊問Dashboard的地址 (即魔盒IP)admin_port = 7400 # Dashboard端口admin_user = admin # Dashboard用戶名admin_pwd = admin # Dashboard密碼[imtnas] # 服務名稱(多個服務不能重名)type = http # http協議local_ip = 10.10.1.51 # 需穿透的設備內網IP(我的魔盒是10.10.1.51)local_port = 8060 # 8060是導航頁面的端口custom_domains = imtnas.kingsir.ga # 填寫你登記的域名增設frpc為系統服務:系統服務可以做到 啟動/停止/重新啟動/查看狀態 的功能.創建frpc的守護進程文件:(在ssh內貼上, enter)cat >> /etc/init.d/frpc << EOF #!/bin/sh ### BEGIN INIT INFO # Provides: frpc # Required-Start: $local_fs $network # Required-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 …