liostech / callbackin
Simple library for receive mqtt message and make http request from data
dev-main
2022-07-17 13:13 UTC
Requires
- php: ^7.4|^8.0
- illuminate/config: ~7.0|~8.0|~9.0
- illuminate/support: ~7.0|~8.0|~9.0
- php-mqtt/client: ^1.0
This package is auto-updated.
Last update: 2023-05-17 14:55:33 UTC
README
CALLBACKIN
Callbackin a plugin for handling and interfacing a callback from server to localhost.
HOW IS Works?
Callbackin is a plugin for handling and interfacing a callback from server to localhost using mqtt.
when server send a callback to https://callbackin.herokuapp.com/{your randomstring} , server in heroku (callbackin server) will send a callback to localhost (callbackin library) via mqtt and the library will send same data and header to CALLBACKIN_LOCAL_ENDPOINT.
if you want to use your own callbackin server you can see my server code in github
HOW TO USE
- Create a new laravel app.
- install this plugin.
composer require liostech/callbackin
- Add this line to your .env file:
CALLBACKIN_LOCAL_ENDPOINT=http://localhost:8000/localendpoint CALLBACKIN_PUBLIC_PATH=randomstring
- Run this command:
php artisan callbackin:listen
- Set your callback url to:
https://callbackin.herokuapp.com/{your randomstring}