{"id":13582034,"url":"https://github.com/greenpau/caddy-trace","last_synced_at":"2025-03-17T08:36:46.711Z","repository":{"id":57542834,"uuid":"293291233","full_name":"greenpau/caddy-trace","owner":"greenpau","description":"Request Debugging Middleware Plugin for Caddy v2","archived":false,"fork":false,"pushed_at":"2023-12-02T22:16:53.000Z","size":378,"stargazers_count":59,"open_issues_count":1,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-05-23T01:33:09.611Z","etag":null,"topics":["caddy","caddy-plugin","debug","debugging","debugging-tool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/greenpau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-09-06T14:15:50.000Z","updated_at":"2024-05-01T23:25:05.000Z","dependencies_parsed_at":"2024-01-04T04:43:13.328Z","dependency_job_id":null,"html_url":"https://github.com/greenpau/caddy-trace","commit_stats":{"total_commits":52,"total_committers":2,"mean_commits":26.0,"dds":"0.038461538461538436","last_synced_commit":"b849748ae8ff2e3a1c2c92b382cdc73f3d94dca0"},"previous_names":["greenpau/caddy-request-debug"],"tags_count":13,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fcaddy-trace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fcaddy-trace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fcaddy-trace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/greenpau%2Fcaddy-trace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/greenpau","download_url":"https://codeload.github.com/greenpau/caddy-trace/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243709133,"owners_count":20334960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["caddy","caddy-plugin","debug","debugging","debugging-tool"],"created_at":"2024-08-01T15:02:23.799Z","updated_at":"2025-03-17T08:36:46.669Z","avatar_url":"https://github.com/greenpau.png","language":"Go","funding_links":[],"categories":["Go","others"],"sub_categories":[],"readme":"# caddy-trace\n\n\u003ca href=\"https://github.com/greenpau/caddy-trace/actions/\" target=\"_blank\"\u003e\u003cimg src=\"https://github.com/greenpau/caddy-trace/workflows/build/badge.svg?branch=main\"\u003e\u003c/a\u003e\n\u003ca href=\"https://pkg.go.dev/github.com/greenpau/caddy-trace\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/godoc-reference-blue.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://caddy.community\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/community-forum-ff69b4.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://caddyserver.com/docs/modules/http.handlers.trace\" target=\"_blank\"\u003e\u003cimg src=\"https://img.shields.io/badge/caddydocs-trace-green.svg\"\u003e\u003c/a\u003e\n\nRequest Debugging Middleware Plugin for [Caddy v2](https://github.com/caddyserver/caddy).\n\n\u003c!-- begin-markdown-toc --\u003e\n## Table of Contents\n\n* [Overview](#overview)\n* [Getting Started](#getting-started)\n\n\u003c!-- end-markdown-toc --\u003e\n\n## Overview\n\nThe plugin is a middleware which displays the content of the request it\nhandles. It helps troubleshooting web requests by exposing headers\n(e.g. cookies), URL parameters, etc.\n\nFor background, the idea for the creation of plugin came during a\ndevelopment of another plugin which rewrites headers of web requests.\nThere was a need to compare \"before and after\" content of the request.\n\nThe `trace` directive gets inserted prior to the plugin which\nmodifies a request and immediately after it. The log with the content\nof the request show up twice and it is easy to compare the two.\n\n## Getting Started\n\nAdd `trace` handler to enable this plugin.\n\nThe `disabled=yes` argument disables the operation of the plugin.\n\nThe `tag` argument injects the value in the log output. This way, one can have\nmultiple handlers and there is a way to deferentiate between them.\n\nThe `response_debug` argument instructs the plugin to buffer\nresponses and log response related metadata, i.e. status codes, length, etc.\n\nThe `uri_filter` directive instructs the plugin to intercepts only\nthe requests with the URI matching the regular expression in the filter.\n\nWhen a request arrives for `/version`, the plugin will be triggered two (2)\ntimes. The first handler is disables. The two (2) other handlers will trigger\nwith different tags. The `respond` handler is terminal and it means the handler\nwith `marvel` tag will not trigger.\n\nWhen a request arrives for `/whoami`, the plugin will be triggered three (2)\ntimes because `respond /version` will not terminate the handling of the plugin.\nNotably, the plugin will output response metadata due to the presence of\n`response_debug` argument.\n\n```\n{\n  http_port     9080\n  https_port    9443\n}\n\nlocalhost:9080 {\n  route {\n    trace disabled=yes\n    trace disabled=no tag=\"foo\"\n    trace disabled=no tag=\"bar\"\n    respond /version \"1.0.0\" 200\n    trace tag=\"marvel\" response_debug=yes\n    trace tag=\"custom\" response_debug=yes uri_filter=\"^/whoami$\"\n    respond /whoami 200 {\n      body \"greenpau\"\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenpau%2Fcaddy-trace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgreenpau%2Fcaddy-trace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgreenpau%2Fcaddy-trace/lists"}