Compare commits
4 Commits
0ea4edc606
...
4d41fb7f5b
Author | SHA1 | Date | |
---|---|---|---|
|
4d41fb7f5b | ||
|
77990c31ef | ||
|
57d51e3f62 | ||
|
ab62011bc8 |
@ -1,6 +1,7 @@
|
|||||||
### Fixes
|
### Fixes
|
||||||
|
|
||||||
* Fixed an issue where HTTP/2 was not enabled for https2http and https2https plugins.
|
* Fixed an issue where HTTP/2 was not enabled for https2http and https2https plugins.
|
||||||
|
* Fixed the issue where the default values of INI configuration parameters are inconsistent with other configuration formats.
|
||||||
|
|
||||||
### Changes
|
### Changes
|
||||||
|
|
||||||
|
BIN
demonstrated_images/Untitled (1).png
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
demonstrated_images/Untitled (10).png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
demonstrated_images/Untitled (11).png
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
demonstrated_images/Untitled (12).png
Normal file
After Width: | Height: | Size: 79 KiB |
BIN
demonstrated_images/Untitled (13).png
Normal file
After Width: | Height: | Size: 37 KiB |
BIN
demonstrated_images/Untitled (14).png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
demonstrated_images/Untitled (15).png
Normal file
After Width: | Height: | Size: 25 KiB |
BIN
demonstrated_images/Untitled (16).png
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
demonstrated_images/Untitled (17).png
Normal file
After Width: | Height: | Size: 44 KiB |
BIN
demonstrated_images/Untitled (18).png
Normal file
After Width: | Height: | Size: 61 KiB |
BIN
demonstrated_images/Untitled (19).png
Normal file
After Width: | Height: | Size: 26 KiB |
BIN
demonstrated_images/Untitled (2).png
Normal file
After Width: | Height: | Size: 76 KiB |
BIN
demonstrated_images/Untitled (20).png
Normal file
After Width: | Height: | Size: 34 KiB |
BIN
demonstrated_images/Untitled (21).png
Normal file
After Width: | Height: | Size: 38 KiB |
BIN
demonstrated_images/Untitled (22).png
Normal file
After Width: | Height: | Size: 155 KiB |
BIN
demonstrated_images/Untitled (3).png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
demonstrated_images/Untitled (4).png
Normal file
After Width: | Height: | Size: 193 KiB |
BIN
demonstrated_images/Untitled (5).png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
demonstrated_images/Untitled (6).png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
demonstrated_images/Untitled (7).png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
demonstrated_images/Untitled (8).png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
demonstrated_images/Untitled (9).png
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
demonstrated_images/Untitled.png
Normal file
After Width: | Height: | Size: 10 KiB |
159
demonstrated_readme/README.md
Normal file
@ -0,0 +1,159 @@
|
|||||||
|
# Expose local Port - > frp-demonstration
|
||||||
|
|
||||||
|
Reference → [https://github.com/REZ-OAN/frp](https://github.com/REZ-OAN/frp)
|
||||||
|
|
||||||
|
# Step-1 Go on your vm or bm
|
||||||
|
|
||||||
|
Goto your server
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
# Step-2 Download release and Extract It (on vm or bm)
|
||||||
|
|
||||||
|
Download the latest release from the github repo
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Select the one which meet your system architecture
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now using `wget` download the release
|
||||||
|
|
||||||
|
```bash
|
||||||
|
wget https://github.com/REZ-OAN/frp/releases/download/v0.57.0/frp_0.57.0_linux_amd64.tar.gz
|
||||||
|
```
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
In this directory you will see like this
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now extract the `.tar.gz` file
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now `goto` `frp_0.57.0_linux_amd64/` this folder
|
||||||
|
|
||||||
|
This files will be there
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
# 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-server`will listen to
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Using `nano` edit the `bindPort` if you want to
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
I have edited the port number
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now run the server
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./frps -c ./frps.toml
|
||||||
|
```
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
# Step-4 Running our codeserver-python (on local machine)
|
||||||
|
|
||||||
|
First need to pull the image from the docker.hub
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker pull poridhi/codeserver-python:v1.2
|
||||||
|
```
|
||||||
|
|
||||||
|
Now, run this and copy the image id to run the image
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker images
|
||||||
|
```
|
||||||
|
|
||||||
|
Run using below command
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker run -it -p 5000:8080 b25217878034
|
||||||
|
```
|
||||||
|
|
||||||
|
Your terminal will look like this
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
# 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`
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Here, `serverAddr` refers to the server from where you locally running service will be **exposed**
|
||||||
|
|
||||||
|
And `serverPort` refers to the port where the`frp-server` is listening
|
||||||
|
|
||||||
|
And `localPort` refers to the port in which our service is **running**
|
||||||
|
|
||||||
|
And `remotePort` refers to the `port`in 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`
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now run the `frp-client`
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./frpc -c ./frpc.toml
|
||||||
|
```
|
||||||
|
|
||||||
|
# Step-6 create tunnel on cloudflare and then expose the port
|
||||||
|
|
||||||
|
Go to cloudflare dashboard select the `Zero Trust`
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Then open networks drop down and select the tunnels
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now click on `create tunnel`
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Select the recommended connector
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Then click on `next` and then give a name i choose `test-frp`
|
||||||
|
|
||||||
|
Now choose connector environment , i have chosen `docker`
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now copy the connector `command` and run it on `detach` mode on your `server` ( in our case 103.174.50.21)
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now select the domain and subdomain , and the url server `ip_address:remotePort`
|
||||||
|
|
||||||
|
.png)
|
||||||
|
|
||||||
|
Now hit the URL `test-frp.poridhi.io/?folder=/app/` will see
|
||||||
|
|
||||||
|
.png)
|
@ -345,35 +345,19 @@ func copySection(source, target *ini.Section) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GetDefaultClientConf returns a client configuration with default values.
|
// GetDefaultClientConf returns a client configuration with default values.
|
||||||
|
// Note: Some default values here will be set to empty and will be converted to them
|
||||||
|
// new configuration through the 'Complete' function to set them as the default
|
||||||
|
// values of the new configuration.
|
||||||
func GetDefaultClientConf() ClientCommonConf {
|
func GetDefaultClientConf() ClientCommonConf {
|
||||||
return ClientCommonConf{
|
return ClientCommonConf{
|
||||||
ClientConfig: legacyauth.GetDefaultClientConf(),
|
ClientConfig: legacyauth.GetDefaultClientConf(),
|
||||||
ServerAddr: "0.0.0.0",
|
|
||||||
ServerPort: 7000,
|
|
||||||
NatHoleSTUNServer: "stun.easyvoip.com:3478",
|
|
||||||
DialServerTimeout: 10,
|
|
||||||
DialServerKeepAlive: 7200,
|
|
||||||
HTTPProxy: os.Getenv("http_proxy"),
|
|
||||||
LogFile: "console",
|
|
||||||
LogWay: "console",
|
|
||||||
LogLevel: "info",
|
|
||||||
LogMaxDays: 3,
|
|
||||||
AdminAddr: "127.0.0.1",
|
|
||||||
PoolCount: 1,
|
|
||||||
TCPMux: true,
|
TCPMux: true,
|
||||||
TCPMuxKeepaliveInterval: 60,
|
|
||||||
LoginFailExit: true,
|
LoginFailExit: true,
|
||||||
Start: make([]string, 0),
|
|
||||||
Protocol: "tcp",
|
Protocol: "tcp",
|
||||||
QUICKeepalivePeriod: 10,
|
Start: make([]string, 0),
|
||||||
QUICMaxIdleTimeout: 30,
|
|
||||||
QUICMaxIncomingStreams: 100000,
|
|
||||||
TLSEnable: true,
|
TLSEnable: true,
|
||||||
DisableCustomTLSFirstByte: true,
|
DisableCustomTLSFirstByte: true,
|
||||||
HeartbeatInterval: 30,
|
|
||||||
HeartbeatTimeout: 90,
|
|
||||||
Metas: make(map[string]string),
|
Metas: make(map[string]string),
|
||||||
UDPPacketSize: 1500,
|
|
||||||
IncludeConfigFiles: make([]string, 0),
|
IncludeConfigFiles: make([]string, 0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -200,34 +200,20 @@ type ServerCommonConf struct {
|
|||||||
NatHoleAnalysisDataReserveHours int64 `ini:"nat_hole_analysis_data_reserve_hours" json:"nat_hole_analysis_data_reserve_hours"`
|
NatHoleAnalysisDataReserveHours int64 `ini:"nat_hole_analysis_data_reserve_hours" json:"nat_hole_analysis_data_reserve_hours"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetDefaultServerConf returns a server configuration with reasonable
|
// GetDefaultServerConf returns a server configuration with reasonable defaults.
|
||||||
// defaults.
|
// Note: Some default values here will be set to empty and will be converted to them
|
||||||
|
// new configuration through the 'Complete' function to set them as the default
|
||||||
|
// values of the new configuration.
|
||||||
func GetDefaultServerConf() ServerCommonConf {
|
func GetDefaultServerConf() ServerCommonConf {
|
||||||
return ServerCommonConf{
|
return ServerCommonConf{
|
||||||
ServerConfig: legacyauth.GetDefaultServerConf(),
|
ServerConfig: legacyauth.GetDefaultServerConf(),
|
||||||
BindAddr: "0.0.0.0",
|
DashboardAddr: "0.0.0.0",
|
||||||
BindPort: 7000,
|
LogFile: "console",
|
||||||
QUICKeepalivePeriod: 10,
|
LogWay: "console",
|
||||||
QUICMaxIdleTimeout: 30,
|
DetailedErrorsToClient: true,
|
||||||
QUICMaxIncomingStreams: 100000,
|
TCPMux: true,
|
||||||
VhostHTTPTimeout: 60,
|
AllowPorts: make(map[int]struct{}),
|
||||||
DashboardAddr: "0.0.0.0",
|
HTTPPlugins: make(map[string]HTTPPluginOptions),
|
||||||
LogFile: "console",
|
|
||||||
LogWay: "console",
|
|
||||||
LogLevel: "info",
|
|
||||||
LogMaxDays: 3,
|
|
||||||
DetailedErrorsToClient: true,
|
|
||||||
TCPMux: true,
|
|
||||||
TCPMuxKeepaliveInterval: 60,
|
|
||||||
TCPKeepAlive: 7200,
|
|
||||||
AllowPorts: make(map[int]struct{}),
|
|
||||||
MaxPoolCount: 5,
|
|
||||||
MaxPortsPerClient: 0,
|
|
||||||
HeartbeatTimeout: 90,
|
|
||||||
UserConnTimeout: 10,
|
|
||||||
HTTPPlugins: make(map[string]HTTPPluginOptions),
|
|
||||||
UDPPacketSize: 1500,
|
|
||||||
NatHoleAnalysisDataReserveHours: 7 * 24,
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|