commit 3aa8881fb549d808a1dca2f6eccc5e6e42b578d5
| author | 斟酌 鵬兄 <tgckpg@gmail.com> |
| date | 2026-05-29T23:52:12Z |
| subject | Update README and man pages |
commit 3aa8881fb549d808a1dca2f6eccc5e6e42b578d5
Author: 斟酌 鵬兄 <tgckpg@gmail.com>
Date: 2026-05-29T23:52:12Z
Update README and man pages
---
README.md | 2 +-
docs/tinyproxy.conf.5.scd | 8 ++++----
fuzz/Makefile | 4 +---
src/file_conf.c | 35 +----------------------------------
4 files changed, 7 insertions(+), 42 deletions(-)
diff --git a/README.md b/README.md
index 48d9eec..f3068f7 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ Run with config file:
tinyproxy -c tinyproxy.conf
```
-check tinyproxy.conf for a more complete setup
+check example/tinyproxy.conf or use `man 5 tinyproxy` after `make install-man` for details
## Non-goals
diff --git a/docs/tinyproxy.conf.5.scd b/docs/tinyproxy.conf.5.scd
index 14e92c4..02f599c 100644
--- a/docs/tinyproxy.conf.5.scd
+++ b/docs/tinyproxy.conf.5.scd
@@ -19,19 +19,19 @@ listen <listen-proto> <listen-endpoint> <backend-proto> <backend-endpoint> [opti
# OPTIONS
proxy_v2
- Enable proxy v2 for upstream
+ Enable proxy v2 for upstream.
Default: false
keep_alive
- Enable keep alive for tcp
+ Enable keep alive for tcp.
Default: false
idle_timeout=SECONDS
- Idle timeout for both listen and upstream
+ Idle timeout for both listen and upstream.
Default: 60
connect_timeout=SECONDS
- Connection timeout for both listen and upstream
+ Connection timeout for both listen and upstream.
Default: 5
# ENDPOINTS
diff --git a/fuzz/Makefile b/fuzz/Makefile
index fbe7418..e6aebe7 100644
--- a/fuzz/Makefile
+++ b/fuzz/Makefile
@@ -28,9 +28,6 @@ COMMON_FUZZ_SRC := \
all: $(BINS)
-$(OUT):
- mkdir -p $(OUT)
-
$(OUT)/fuzz_proxy_v2_build: fuzz_proxy_v2_build.c $(PROJECT_SRCS)
$(CC) $(CFLAGS) $(FUZZ_CFLAGS) $(CPPFLAGS) \
-I$(SRC_DIR) \
@@ -59,6 +56,7 @@ seed-%: FORCE
fi
run-%: $(OUT)/fuzz_% seed-%
+ mkdir -p $(OUT)
$(OUT)/fuzz_$* \
$(CORPUS)/$* \
-max_total_time=$${MAX_TOTAL_TIME:-60} \
diff --git a/src/file_conf.c b/src/file_conf.c
index 1d193ba..e5943fd 100644
--- a/src/file_conf.c
+++ b/src/file_conf.c
@@ -252,23 +252,6 @@ static inline void route_options_set_defaults(struct route_options *opts)
opts->connect_timeout_sec = ROUTE_DEFAULT_CONNECT_TIMEOUT_SEC;
}
-static const char *file_uri_path(const char *s)
-{
- const char *path = s + 7; /* file:// */
-
-#ifdef _WIN32
- /* Accept file:///C:/path as C:/path */
- if (path[0] == '/' &&
- ((path[1] >= 'A' && path[1] <= 'Z') ||
- (path[1] >= 'a' && path[1] <= 'z')) &&
- path[2] == ':') {
- path++;
- }
-#endif
-
- return path;
-}
-
static int parse_endpoint(enum endpoint_proto proto, const char *s, struct endpoint *ep)
{
const char *path;
@@ -290,10 +273,6 @@ static int parse_endpoint(enum endpoint_proto proto, const char *s, struct endpo
case PROTO_UNIX_STREAM:
path = s;
- if (strncmp(path, "unix:", 5) == 0) {
- path += 5;
- }
-
if (path[0] == '\0' || strlen(path) >= sizeof(ep->path)) {
return -1;
}
@@ -305,10 +284,6 @@ static int parse_endpoint(enum endpoint_proto proto, const char *s, struct endpo
case PROTO_UNIX_DGRAM:
path = s;
- if (strncmp(path, "unix-dgram:", 11) == 0) {
- path += 11;
- }
-
if (path[0] == '\0' || strlen(path) >= sizeof(ep->path)) {
return -1;
}
@@ -318,11 +293,7 @@ static int parse_endpoint(enum endpoint_proto proto, const char *s, struct endpo
return 0;
case PROTO_FILE:
- if (strncmp(s, "file://", 7) == 0) {
- path = file_uri_path(s);
- } else {
- path = s;
- }
+ path = s;
if (path[0] == '\0') {
LOG_ERROR("missing file path");
@@ -344,10 +315,6 @@ static int parse_endpoint(enum endpoint_proto proto, const char *s, struct endpo
enum x_builtin_upstream builtin;
const char *name = s;
- if (strncmp(name, "builtin://", 10) == 0) {
- name += 10;
- }
-
if (name[0] == '\0' || x_builtin_parse(name, &builtin) < 0) {
return -1;
}