forked from Mxmilu666/frp
add host_header_rewrite in frpc.ini to rewrite your requests with a modified Host header
This commit is contained in:
@@ -138,15 +138,14 @@ func loginToServer(cli *client.ProxyClient) (c *conn.Conn, err error) {
|
||||
|
||||
nowTime := time.Now().Unix()
|
||||
req := &msg.ControlReq{
|
||||
Type: consts.NewCtlConn,
|
||||
ProxyName: cli.Name,
|
||||
UseEncryption: cli.UseEncryption,
|
||||
UseGzip: cli.UseGzip,
|
||||
PrivilegeMode: cli.PrivilegeMode,
|
||||
ProxyType: cli.Type,
|
||||
LocalIp: cli.LocalIp,
|
||||
LocalPort: cli.LocalPort,
|
||||
Timestamp: nowTime,
|
||||
Type: consts.NewCtlConn,
|
||||
ProxyName: cli.Name,
|
||||
UseEncryption: cli.UseEncryption,
|
||||
UseGzip: cli.UseGzip,
|
||||
PrivilegeMode: cli.PrivilegeMode,
|
||||
ProxyType: cli.Type,
|
||||
HostHeaderRewrite: cli.HostHeaderRewrite,
|
||||
Timestamp: nowTime,
|
||||
}
|
||||
if cli.PrivilegeMode {
|
||||
privilegeKey := pcrypto.GetAuthKey(cli.Name + client.PrivilegeToken + fmt.Sprintf("%d", nowTime))
|
||||
|
||||
@@ -276,8 +276,7 @@ func doLogin(req *msg.ControlReq, c *conn.Conn) (ret int64, info string) {
|
||||
// set infomations from frpc
|
||||
s.UseEncryption = req.UseEncryption
|
||||
s.UseGzip = req.UseGzip
|
||||
s.ClientIp = req.LocalIp
|
||||
s.ClientPort = req.LocalPort
|
||||
s.HostHeaderRewrite = req.HostHeaderRewrite
|
||||
|
||||
// start proxy and listen for user connections, no block
|
||||
err := s.Start(c)
|
||||
|
||||
Reference in New Issue
Block a user