Conversation
I added an extractor `RemoteAddr` in the `extractors.rs`. This extractor works by getting an extension from the HTTP headers which contains the remote address. For this extension to be set, axum has to be started with `handler.into_make_service_with_connect_info`. The extractor then provides the IP address. Furthermore, when a proxied connection was declared using one of the following headers, the proxied IP will be used: - CF-Connecting-IP - CloudFront-Viewer-Address - Fly-Client-IP - Forwarded - X-Forwarded-For - True-Client-IP - X-Envoy-External-Address - X-Real-Ip In order to implement proxied HTTP header detection the `client_ip` crate was used. In order to comply with the orphan rules, `cot-core` was given access to `tokio` via `tokio.workspace = true`.
Wervice
marked this pull request as draft
September 16, 2026 12:08
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I added an extractor
RemoteAddrin theextractors.rs. This extractor works by getting an extension from the HTTP headers which contains the remote address.For this extension to be set, axum has to be started with
handler.into_make_service_with_connect_info.The extractor then provides the IP address. Furthermore, when a proxied connection was declared using one of the following headers, the proxied IP will be used:
In order to implement proxied HTTP header detection the
client_ipcrate was used.In order to comply with the orphan rules,
cot-corewas given access totokioviatokio.workspace = true.Related issue or discussion
Description
Type of change
Checklist
just test-all)just clippy)cargo fmt)