frp/demonstrated_readme
2024-05-01 13:11:34 +06:00
..
2024-05-01 13:11:34 +06:00

Expose local Port - > frp-demonstration

Reference → https://github.com/REZ-OAN/frp

Step-1 Go on your vm or bm

Goto your server

Untitled

Step-2 Download release and Extract It (on vm or bm)

Download the latest release from the github repo

Untitled

Select the one which meet your system architecture

Untitled

Now hover on the file and right click on it select the copy link address

Now goto the terminal where you ssh to the server

go to preferred folder where you want to download the release

Untitled

Now using wget download the release

wget https://github.com/REZ-OAN/frp/releases/download/v0.57.0/frp_0.57.0_linux_amd64.tar.gz

Untitled

In this directory you will see like this

Untitled

Now extract the .tar.gz file

Untitled

Now goto frp_0.57.0_linux_amd64/ this folder

This files will be there

Untitled

Step-3 Running frp-server ( on vm or bm)

Now edit the frps.toml because we will run the frp-server on our vm or bm

We need to specify a port on our vm or bm on which the frp-serverwill listen to

Untitled

Using nano edit the bindPort if you want to

Untitled

I have edited the port number

Untitled

Now run the server

./frps -c ./frps.toml

Untitled

Step-4 Running our codeserver-python (on local machine)

First need to pull the image from the docker.hub

docker pull poridhi/codeserver-python:v1.2

Now, run this and copy the image id to run the image

docker images

Run using below command

docker run -it -p 5000:8080 b25217878034

Your terminal will look like this

Untitled

Step-5 Running frp-client (on our local machine)

Firstly do every thing in done in the Step-2 , after doing all of those things

Edit the frpc.toml

Untitled

Here, serverAddr refers to the server from where you locally running service will be exposed

And serverPort refers to the port where thefrp-server is listening

And localPort refers to the port in which our service is running

And remotePort refers to the portin the remoteServer in which our service will be exposed to

Edit the serverPort to 4848 and localPort to 5000 and set remotePort to 7050 using nano

Untitled

Now run the frp-client

./frpc -c ./frpc.toml

Step-6 create tunnel on cloudflare and then expose the port

Go to cloudflare dashboard select the Zero Trust

Untitled

Then open networks drop down and select the tunnels

Untitled

Now click on create tunnel

Untitled

Select the recommended connector

Untitled

Then click on next and then give a name i choose test-frp

Now choose connector environment , i have chosen docker

Untitled

Now copy the connector command and run it on detach mode on your server ( in our case 103.174.50.21)

Untitled

Now select the domain and subdomain , and the url server ip_address:remotePort

Untitled

Now hit the URL test-frp.poridhi.io/?folder=/app/ will see

Untitled