File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed
src/main/scala/com/timzaak/proxy Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ docker run --rm \
4545 ghcr.io/timzaak/log-http-proxy:latest
4646
4747```
48- > Open your browser and navigate to http://127.0.0.1:9000 to view traffic logs.
48+ > Open your browser and navigate to ` http://127.0.0.1:9000 ` to view traffic logs. or with ip ` http://127.0.0.1:9000?ip=${http client ip} `
4949
5050<img src =" /doc/usage.png " alt =" Usage screenshot " width =" 500 " />
5151
Original file line number Diff line number Diff line change @@ -36,10 +36,11 @@ class LogWebViewer(certPath: Option[String])(using system: ActorSystem) {
3636
3737 private val viewerEndpoint = endpoint.get
3838 .in(" " )
39+ .in(query[Option [String ]](" ip" ))
3940 .in(extractFromRequest(identity))
4041 .out(htmlBodyUtf8)
41- .serverLogicSuccess { request =>
42- val ip = extractClientIP(request)
42+ .serverLogicSuccess { (ipParam, request) =>
43+ val ip = ipParam.getOrElse( extractClientIP(request) )
4344 val certDesc = certPath match {
4445 case Some (_) =>
4546 s """ <p>the server use self signed cert, you may need to register the self signed rootCA.pem to your system. </p>
You can’t perform that action at this time.
0 commit comments