This is a simple API to pypass API calls to some services
353
Some countries have restrictions on the internet, and some services are blocked. This can be a problem when you need to send a message to a chat, or make a request to a service. this is where bifrost comes in.
This is a simple API to pypass API calls to some services, for now it only has a endpoint to send messages to a telegram chat. but it can be easily extended to other services.
Note: It doesn't store any information; it just forwards the message to the service. However, in the future, I may try to find a way to prevent any kind of MITM attack.
docker run -d -p 5000:5000 -e BIFROST_ACCESS_TOKEN=your_secret_token saderi/bifrost:latest
Bifrost will be available at http://localhost:5000.
| Endpoint | Method | Description |
|---|---|---|
/ | GET | Health check endpoint. |
/send | GET, POST | Send GET and POST to a URL. |
/send_telegram | POST | Send a message to a telegram chat. |
You can send a GET or POST request to a URL using /send endpoint. json example:
{
"url": "TARGET_API_URL",
"headers": {
"Content-Type": "application/json",
"Authorization": "Bearer TARGET_API_TOKEN if needed"
},
"json_payload": {
"field1": "value1",
"field2": "value2"
}
}
Important Notes:
url is required, headers and json_payload are optional.json_payload will be sent only if the request is a POST request as a json payload.You can send a message to a telegram chat using this endpoint. requieres fields:
chat_id: The chat id of the chat you want to send the message to.message: The message you want to send.telegram_bot_token: The token of the bot you want to use to send the message.Example request:
curl --location 'http://127.0.0.1:5000/send_telegram' \
--request POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN_HERE' \
--data '{
"telegram_bot_token": "9999999999:AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"telegram_chat_id": "-11111111111",
"text": "YOUR TEST"
}'
Response will be exactly the response from the telegram API.
Content type
Image
Digest
sha256:33bf7740c…
Size
49.4 MB
Last updated
almost 2 years ago
docker pull saderi/bifrost