Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
hack3rvaillant authored Oct 31, 2024
1 parent 6018c23 commit df589f8
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This is a lightweight HTTP proxy server built using the Sinatra framework. It ac
## Features

- **CORS Support**: Handles CORS headers, allowing cross-origin requests.
- **JWT Authentication**: Verifies the presence and validity of the `x-bump-jwt-token` header to ensure requests are authorized.
- **JWT Authentication**: Verifies the presence and validity of the `x-bump-proxy-token` header to ensure requests are authorized.
- **Flexible HTTP Method Support**: Supports `GET`, `POST`, `PUT`,`PATCH`, and `DELETE` methods for forwarding client requests to the target server.
- **Automatic Request Forwarding**: Forwards requests to the specified target URL while preserving headers and request bodies.

Expand Down Expand Up @@ -52,24 +52,24 @@ The server verifies the `x-bump-jwt-token` for every request. If the token is mi

The server provides the following endpoints for request forwarding:

- **GET** `?url=your-target-url`
- **POST** `?url=your-target-url`
- **PUT** `?url=your-target-url`
- **PATCH** `?url=your-target-url`
- **DELETE** `?url=your-target-url`
- **GET** `/your-target-url`
- **POST** `?/your-target-url`
- **PUT** `/your-target-url`
- **PATCH** `/your-target-url`
- **DELETE** `/your-target-url`

Each endpoint forwards the request to the target URL specified in the query parameter.

### Example Requests

**GET request:**
```bash
curl -X GET "http://localhost:4567/?url=https://jsonplaceholder.typicode.com/posts" -H "x-bump-jwt-token: YOUR_TOKEN"
curl -X GET "http://localhost:4567/https://jsonplaceholder.typicode.com/posts" -H "x-bump-jwt-token: YOUR_TOKEN"
```

**POST request:**
```bash
curl -X POST "http://localhost:4567/?url=https://jsonplaceholder.typicode.com/posts" \
curl -X POST "http://localhost:4567/https://jsonplaceholder.typicode.com/posts" \
-H "Content-Type: application/json" \
-H "x-bump-jwt-token: YOUR_TOKEN" \
-d '{"title":"foo","body":"bar","userId":1}'
Expand Down

0 comments on commit df589f8

Please sign in to comment.