Provide access to the remote IP address in a handler

Aperta
#671 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Wervice ci sta già lavorando.

Dal 4/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
Rust
Stelle
1.1k
Fork
57
Merge medio
17h 39m
PR unite (30g)
12

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cot-rs/cot

Tutte le issue di cot-rs/cot

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.