Skip to content

Commit 88fcc07

Browse files
authored
Merge pull request fatedier#2792 from fatedier/dev
bump version
2 parents 2dab5d0 + ddc1e16 commit 88fcc07

File tree

23 files changed

+101
-79
lines changed

23 files changed

+101
-79
lines changed

README.md

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,6 @@
66

77
[README](README.md) | [中文文档](README_zh.md)
88

9-
## What is frp?
10-
11-
frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports **TCP** and **UDP**, as well as **HTTP** and **HTTPS** protocols, where requests can be forwarded to internal services by domain name.
12-
13-
frp also has a P2P connect mode.
14-
159
<h3 align="center">Platinum Sponsors</h3>
1610
<!--platinum sponsors start-->
1711

@@ -23,10 +17,27 @@ frp also has a P2P connect mode.
2317

2418
<!--platinum sponsors end-->
2519

20+
<h3 align="center">Gold Sponsors</h3>
21+
<!--gold sponsors start-->
22+
23+
<p align="center">
24+
<a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=frp&utm_source=github" target="_blank">
25+
<img width="300px" src="https://raw.githubusercontent.com/fatedier/frp/dev/doc/pic/sponsor_workos.png">
26+
</a>
27+
</p>
28+
29+
<!--gold sponsors end-->
30+
2631
<h3 align="center">Silver Sponsors</h3>
2732

2833
* Sakura Frp - 欢迎点击 "加入我们"
2934

35+
## What is frp?
36+
37+
frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it supports **TCP** and **UDP**, as well as **HTTP** and **HTTPS** protocols, where requests can be forwarded to internal services by domain name.
38+
39+
frp also has a P2P connect mode.
40+
3041
## Table of Contents
3142

3243
<!-- vim-markdown-toc GFM -->
@@ -82,8 +93,7 @@ frp also has a P2P connect mode.
8293
* [Development Plan](#development-plan)
8394
* [Contributing](#contributing)
8495
* [Donation](#donation)
85-
* [AliPay](#alipay)
86-
* [Wechat Pay](#wechat-pay)
96+
* [GitHub Sponsors](#github-sponsors)
8797
* [PayPal](#paypal)
8898

8999
<!-- vim-markdown-toc -->
@@ -1092,15 +1102,11 @@ Interested in getting involved? We would like to help you!
10921102

10931103
If frp helps you a lot, you can support us by:
10941104

1095-
frp QQ group: 606194980
1096-
1097-
### AliPay
1098-
1099-
![donation-alipay](/doc/pic/donate-alipay.png)
1105+
### GitHub Sponsors
11001106

1101-
### Wechat Pay
1107+
Support us by [Github Sponsors](https://github.com/sponsors/fatedier).
11021108

1103-
![donation-wechatpay](/doc/pic/donate-wechatpay.png)
1109+
You can have your company's logo placed on README file of this project.
11041110

11051111
### PayPal
11061112

README_zh.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ frp 是一个专注于内网穿透的高性能的反向代理应用,支持 TCP
1818

1919
<!--platinum sponsors end-->
2020

21+
<h3 align="center">Gold Sponsors</h3>
22+
<!--gold sponsors start-->
23+
24+
<p align="center">
25+
<a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=frp&utm_source=github" target="_blank">
26+
<img width="300px" src="https://raw.githubusercontent.com/fatedier/frp/dev/doc/pic/sponsor_workos.png">
27+
</a>
28+
</p>
29+
30+
<!--gold sponsors end-->
31+
2132
<h3 align="center">Silver Sponsors</h3>
2233

2334
* Sakura Frp - 欢迎点击 "加入我们"
@@ -65,6 +76,12 @@ frp 是一个免费且开源的项目,我们欢迎任何人为其开发和进
6576

6677
如果您觉得 frp 对你有帮助,欢迎给予我们一定的捐助来维持项目的长期发展。
6778

79+
### GitHub Sponsors
80+
81+
您可以通过 [GitHub Sponsors](https://github.com/sponsors/fatedier) 赞助我们。
82+
83+
企业赞助者可以将贵公司的 Logo 以及链接放置在项目 README 文件中。
84+
6885
### 知识星球
6986

7087
如果您想学习 frp 相关的知识和技术,或者寻求任何帮助及咨询,都可以通过微信扫描下方的二维码付费加入知识星球的官方社群:
@@ -78,7 +95,3 @@ frp 是一个免费且开源的项目,我们欢迎任何人为其开发和进
7895
### 微信支付捐赠
7996

8097
![donate-wechatpay](/doc/pic/donate-wechatpay.png)
81-
82-
### Paypal 捐赠
83-
84-
海外用户推荐通过 [Paypal](https://www.paypal.me/fatedier) 向我的账户 **[email protected]** 进行捐赠。

Release.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
### New
2-
3-
* Added `connect_server_local_ip` in frpc to specify local IP connected to frps.
4-
* Added `tcp_mux_keepalive_interval` both in frpc and frps to set `tcp_mux` keepalive interval seconds if `tcp_mux` is enabled. After using this params, you can set `heartbeat_interval` to `-1` to disable application layer heartbeat to reduce traffic usage(Make sure frps is in the latest version).
5-
6-
### Improve
7-
8-
* Server Plugin: Added `client_address` in Login Operation.
9-
101
### Fix
112

12-
* Remove authentication for healthz api.
3+
* Fixed IPv6 address parse issue.

client/proxy/proxy.go

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -347,22 +347,18 @@ func (pxy *XTCPProxy) InWorkConn(conn net.Conn, m *msg.StartWorkConn) {
347347
xl.Trace("get natHoleRespMsg, sid [%s], client address [%s] visitor address [%s]", natHoleRespMsg.Sid, natHoleRespMsg.ClientAddr, natHoleRespMsg.VisitorAddr)
348348

349349
// Send detect message
350-
array := strings.Split(natHoleRespMsg.VisitorAddr, ":")
351-
if len(array) <= 1 {
352-
xl.Error("get NatHoleResp visitor address error: %v", natHoleRespMsg.VisitorAddr)
350+
host, portStr, err := net.SplitHostPort(natHoleRespMsg.VisitorAddr)
351+
if err != nil {
352+
xl.Error("get NatHoleResp visitor address [%s] error: %v", natHoleRespMsg.VisitorAddr, err)
353353
}
354354
laddr, _ := net.ResolveUDPAddr("udp", clientConn.LocalAddr().String())
355-
/*
356-
for i := 1000; i < 65000; i++ {
357-
pxy.sendDetectMsg(array[0], int64(i), laddr, "a")
358-
}
359-
*/
360-
port, err := strconv.ParseInt(array[1], 10, 64)
355+
356+
port, err := strconv.ParseInt(portStr, 10, 64)
361357
if err != nil {
362358
xl.Error("get natHoleResp visitor address error: %v", natHoleRespMsg.VisitorAddr)
363359
return
364360
}
365-
pxy.sendDetectMsg(array[0], int(port), laddr, []byte(natHoleRespMsg.Sid))
361+
pxy.sendDetectMsg(host, int(port), laddr, []byte(natHoleRespMsg.Sid))
366362
xl.Trace("send all detect msg done")
367363

368364
msg.WriteMsg(conn, &msg.NatHoleClientDetectOK{})

client/visitor.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import (
2020
"fmt"
2121
"io"
2222
"net"
23+
"strconv"
2324
"sync"
2425
"time"
2526

@@ -85,7 +86,7 @@ type STCPVisitor struct {
8586
}
8687

8788
func (sv *STCPVisitor) Run() (err error) {
88-
sv.l, err = net.Listen("tcp", fmt.Sprintf("%s:%d", sv.cfg.BindAddr, sv.cfg.BindPort))
89+
sv.l, err = net.Listen("tcp", net.JoinHostPort(sv.cfg.BindAddr, strconv.Itoa(sv.cfg.BindPort)))
8990
if err != nil {
9091
return
9192
}
@@ -174,7 +175,7 @@ type XTCPVisitor struct {
174175
}
175176

176177
func (sv *XTCPVisitor) Run() (err error) {
177-
sv.l, err = net.Listen("tcp", fmt.Sprintf("%s:%d", sv.cfg.BindAddr, sv.cfg.BindPort))
178+
sv.l, err = net.Listen("tcp", net.JoinHostPort(sv.cfg.BindAddr, strconv.Itoa(sv.cfg.BindPort)))
178179
if err != nil {
179180
return
180181
}
@@ -352,7 +353,7 @@ type SUDPVisitor struct {
352353
func (sv *SUDPVisitor) Run() (err error) {
353354
xl := xlog.FromContextSafe(sv.ctx)
354355

355-
addr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%d", sv.cfg.BindAddr, sv.cfg.BindPort))
356+
addr, err := net.ResolveUDPAddr("udp", net.JoinHostPort(sv.cfg.BindAddr, strconv.Itoa(sv.cfg.BindPort)))
356357
if err != nil {
357358
return fmt.Errorf("sudp ResolveUDPAddr error: %v", err)
358359
}

doc/pic/sponsor_doppler.png

26.2 KB
Loading

doc/pic/sponsor_workos.png

36.6 KB
Loading

pkg/util/net/udp.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import (
1818
"fmt"
1919
"io"
2020
"net"
21+
"strconv"
2122
"sync"
2223
"time"
2324

@@ -163,7 +164,7 @@ type UDPListener struct {
163164
}
164165

165166
func ListenUDP(bindAddr string, bindPort int) (l *UDPListener, err error) {
166-
udpAddr, err := net.ResolveUDPAddr("udp", fmt.Sprintf("%s:%d", bindAddr, bindPort))
167+
udpAddr, err := net.ResolveUDPAddr("udp", net.JoinHostPort(bindAddr, strconv.Itoa(bindPort)))
167168
if err != nil {
168169
return l, err
169170
}

pkg/util/net/websocket.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package net
22

33
import (
44
"errors"
5-
"fmt"
65
"net"
76
"net/http"
7+
"strconv"
88

99
"golang.org/x/net/websocket"
1010
)
@@ -52,7 +52,7 @@ func NewWebsocketListener(ln net.Listener) (wl *WebsocketListener) {
5252
}
5353

5454
func ListenWebsocket(bindAddr string, bindPort int) (*WebsocketListener, error) {
55-
tcpLn, err := net.Listen("tcp", fmt.Sprintf("%s:%d", bindAddr, bindPort))
55+
tcpLn, err := net.Listen("tcp", net.JoinHostPort(bindAddr, strconv.Itoa(bindPort)))
5656
if err != nil {
5757
return nil, err
5858
}

pkg/util/tcpmux/httpconnect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func readHTTPConnectRequest(rd io.Reader) (host string, err error) {
4848
return
4949
}
5050

51-
host = util.GetHostFromAddr(req.Host)
51+
host, _ = util.CanonicalHost(req.Host)
5252
return
5353
}
5454

0 commit comments

Comments
 (0)