Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add http2http client plugin with hostHeaderRewrite and requestHeaders support #4275

Merged
merged 5 commits into from
Jun 12, 2024

Conversation

fatedier
Copy link
Owner

@fatedier fatedier commented Jun 12, 2024

Implements the http2http client plugin and updates configuration options to support hostHeaderRewrite and requestHeaders.

  • New Plugin Implementation: Adds a new file pkg/plugin/client/http2http.go implementing the http2http client plugin. This plugin supports rewriting the host header and setting custom request headers, similar to the existing http2https plugin.
  • Configuration Update: Modifies pkg/config/v1/plugin.go to include the http2http plugin in the list of client plugins. Adds HTTP2HTTPPluginOptions struct to support hostHeaderRewrite and requestHeaders configuration options for the http2http plugin.

For more details, open the Copilot Workspace session.

Adds license information to the newly created `pkg/plugin/client/http2http.go` file.

- **License Addition**: Incorporates Apache License 2.0 information at the top of the `http2http.go` file, aligning with the repository's licensing practices for source files.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/fatedier/frp/pull/4275?shareId=07b6614a-5cf5-4f9f-be18-0256c8aad313).
Adds support for a new "http2http" plugin in the configuration and implementation.

- Introduces a new constant `PluginHTTP2HTTP` to represent the "http2http" plugin in the plugin configuration.
- Adds `HTTP2HTTPPluginOptions` struct to define the options available for the "http2http" plugin, including local address binding, host header rewrite, and custom request headers.
- Implements the `http2http` plugin in `http2http.go`, which includes the setup of a reverse proxy server that forwards HTTP requests to another HTTP server based on the specified plugin options.
- Registers the "http2http" plugin with the plugin system, allowing it to be utilized in client configurations.


---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/fatedier/frp/pull/4275?shareId=a866fdb3-e40a-4d40-9326-546dc4efce63).
@fatedier fatedier marked this pull request as ready for review June 12, 2024 08:16
@fatedier fatedier merged commit 939c490 into dev Jun 12, 2024
2 checks passed
@fatedier fatedier deleted the add-http2http-plugin branch June 12, 2024 09:30
github-actions bot added a commit to aiastia-dockerhub/frp that referenced this pull request Jun 12, 2024
* https://github.com/fatedier/frp:
  Add http2http client plugin with hostHeaderRewrite and requestHeaders support (fatedier#4275)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant