Postback Catcher is a small and simple Go server for receiving and storing postbacks from various sources. It is designed to be easy to use and deploy, requiring minimal configuration.
- Receive postbacks via multiple HTTP methods (GET, POST, PUT, DELETE, etc.)
- Store postbacks in a BBoltDB database
- Query stored postbacks with customizable limit
- Delete stored postbacks by ID
- Test URL redirection with custom headers
- Health check endpoint
- Clone the repository:
git clone https://github.com/erolatex/postback-catcher.git- Change into the project directory:
cd postback-catcher- Build the binary:
go build -o postback-catcher- Run the binary:
./postback-catcherThe server will start on port 8081 by default. You can change the port by modifying the port constant in the source code.
To run this application using Docker, follow these steps:
- Make sure you have Docker installed on your system.
- Pull the latest image from Docker Hub:
docker pull erolatex/postback-catcher:latest- Run the container with the image, binding the host port to the container port. If you want the application to be accessible on port 80, run the following command:
docker run -d -p 80:8081 --name postback-catcher erolatex/postback-catcher:latestThis command runs the container with the name "postback-catcher", binds the host's port 80 to the container's port 8081, and uses the image erolatex/postback-catcher:latest.
Now, your application should be accessible on your host's port 80. If you need to use a different port, simply replace 80 with the desired port in the -p parameter.
Make an HTTP request to the server with the desired method and parameters:
curl -X POST http://localhost:8081/somepath?param1=value1 -d "request body"Get the stored postbacks with an optional limit:
curl http://localhost:8081/get?limit=5Delete a postback by ID:
curl -X DELETE http://localhost:8081/delete/your_postback_id_hereRedirect to a test URL with custom headers:
curl http://localhost:8081/test-url?header=Location&value=https://example.comCheck the server health:
curl http://localhost:8081/healthPlease feel free to submit issues, fork the repository and send pull requests!
This project is licensed under the MIT License - see the LICENSE file for details.