8000 Adding stats template with JSON output by Napsty · Pull Request #467 · tinyproxy/tinyproxy · GitHub
[go: up one dir, main page]

Skip to content

Adding stats template with JSON output #467

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Napsty
Copy link
@Napsty Napsty commented Dec 15, 2022

This PR adds a very simple yet useful stats template with JSON output.
HTML formatting is not required for a pure JSON output.
The first curly brace is set "twice" on purpose, otherwise Tinyproxy itself thinks a variable needs to be parsed.

Works fine in my environment with version 1.10.0 on Debian Bullseye:

ck@linux:~# grep StatFile /etc/tinyproxy/tinyproxy.conf 
# StatFile: The HTML file that gets sent when a request is made
StatFile "/usr/share/tinyproxy/stats-json.html"

ck@linux:~# curl -H "Host: tinyproxy.stats" http://127.0.0.1:8888
{ "version":"1.10.0", "open":1, "requests":267, "bad":2, "denied":2, "refused":0 }

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.

1 participant
0