Provide access to the remote IP address in a handler

Open
#671 1 comment 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@Wervice is already working on this.

Since Oct 4, 2026.

Assessment

This issue has not been assessed yet.

Description

Problem statement

Currently, I see no way to get the remote IP address inside the handler, which may be necessary for logging, rate-limiting, login-control and so on.

Proposed solution

Cot could provide a remote_addr: IpAddr inside as a handler argument.

Alternatives considered

No response

Drawbacks

No response

Additional context

I tried to workaround this problem myself by writing my own middleware, but I could not find an explanation on how to do so nor an answer to the question whether making own middleware is an intended use of Cots' API.

Dominant language
Rust
Stars
1.1k
Forks
57
Avg merge
17h 39m
Merged PRs (30d)
12

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cot-rs/cot

All issues in cot-rs/cot

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.