diff --git a/README.md b/README.md index 931a4e2..c8ea163 100644 --- a/README.md +++ b/README.md @@ -52,13 +52,13 @@ ``` ### Client Specific Options ``` --H, --header= A header to add to request in the form name:value. Use - multiple times for multiple headers. +-H, --header A header to add to request in the form name|value. Use + multiple times for multiple headers. --m, --method=[GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS] - HTTP method for request (default: GET). +-m, --method [GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS] + HTTP method for request (default: GET). --b, --body= Request body to send. +-b, --body Request body to send. ``` ### Example @@ -67,8 +67,8 @@ httpcat client \ --method POST \ --body "Testing 123" \ - --header "Content-Type: text/plain" \ - --header "Authorization: Bearer abc123" \ + --header "Content-Type|text/plain" \ + --header "Authorization|Bearer abc123" \ http://localhost:8080/api/testing ``` @@ -87,17 +87,17 @@ ### Server Specific Options ``` --p, --port= Port to listen on. (default: 8080). +-p, --port Port to listen on. (default: 8080). --r, --route= Route which is made up of a path, a response body, a content type, and a - response status, all separated by the pipe '|' character. - Repeat for additional routes. +-r, --route Route which is made up of a path, a response body, a + content type, and a response status, all separated by + the pipe '|' character. Repeat for additional routes. --c, --cors Enable Cross Origin Resource Sharing (CORS). Allows all - requested methods and headers. +-c, --cors Enable Cross Origin Resource Sharing (CORS). Allows all + requested methods and headers. --H, --header= A header to add to response in the form name:value. Use - multiple times for multiple headers. +-H, --header A header to add to response in the form name|value. Use + multiple times for multiple headers. ``` ### Example @@ -162,7 +162,7 @@ ## Proxy Mode -Creates a reverse proxy that displays all HTTP requests and responses that pass through it. +Creates a reverse proxy that displays all HTTP requests and responses that pass through it. It will rewrite the port for redirect responses. ### Usage @@ -172,10 +172,10 @@ ### Proxy Specific Options ``` --p, --port= The port that the proxy listens on. +-p, --port The port that the proxy listens on. --t, --target= The URL for the target web server that the proxy forwards - requests to. +-t, --target The URL for the target web server that the proxy forwards + requests to. ``` ### Example @@ -184,7 +184,7 @@ httpcat proxy --port 8090 --target http://localhost:8080 ``` -Any requests sent to port 8090 will be forwarded to `http://localhost:8080` and all requests and responses will be displayed. +Any requests sent to port 8090 will be forwarded to `http://localhost:8080` and all requests and responses will be displayed. Any redirect responses will be rewritten to use the specified port. ## Building @@ -193,6 +193,16 @@ go build -o ../httpcat ``` +### Stripping + +``` +go build -ldflags "-s -w" -o ../httpcat +``` + +See the `link` docs for information on flags: + +https://pkg.go.dev/cmd/link + ### Cross Compiling Linux