Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions .vscode/launch.json

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Proxyee is a JAVA written HTTP proxy server library that supports HTTP, HTTPS, W
<dependency>
<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.6.9</version>
<version>1.7.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion README_zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Proxyee 是一个 JAVA 编写的 HTTP 代理服务器类库,支持 HTTP、HTTP
<dependency>
<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.6.9</version>
<version>1.7.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>com.github.monkeywie</groupId>
<artifactId>proxyee</artifactId>
<version>1.6.9</version>
<version>1.7.0</version>

<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,6 @@ private void handleProxyData(Channel channel, Object msg, boolean isHttp) throws
RequestProto newRP = ProtoUtil.getRequestProto(httpRequest);
if (!newRP.equals(pipeRp)) {
isChangeRp = true;
// 更新Host请求头
if ((pipeRp.getSsl() && pipeRp.getPort() == 443)
|| (!pipeRp.getSsl() && pipeRp.getPort() == 80)) {
httpRequest.headers().set(HttpHeaderNames.HOST, pipeRp.getHost());
} else {
httpRequest.headers().set(HttpHeaderNames.HOST, pipeRp.getHost() + ":" + pipeRp.getPort());
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.github.monkeywie.proxyee.server.HttpProxyServerConfig;
import com.github.monkeywie.proxyee.util.HttpUtil;
import io.netty.channel.Channel;
import io.netty.handler.codec.http.HttpHeaderNames;
import io.netty.handler.codec.http.HttpRequest;

/**
Expand Down Expand Up @@ -37,6 +38,7 @@ public void beforeRequest(Channel clientChannel, HttpRequest httpRequest,
pipeline.getRequestProto().setHost("www.taobao.com");
pipeline.getRequestProto().setPort(443);
pipeline.getRequestProto().setSsl(true);
httpRequest.headers().set(HttpHeaderNames.HOST, "www.taobao.com");
}
pipeline.beforeRequest(clientChannel, httpRequest);
}
Expand Down