georgeboot / laravel-echo-api-gateway

Use Laravel Echo with API Gateway Websockets. Works with Bref.sh and Laravel Vapor.
MIT License
99 stars 22 forks source link

How to support local development environment without an AWS account? #8

Open mikebronner opened 3 years ago

mikebronner commented 3 years ago

Hi @georgeboot, do you have any thoughts on how one might develop locally using https://github.com/tlaverdure/Laravel-Echo-Server, while on staging and production (Vapor) using your package?

There obviously needs to be a condition in bootstrap.js, but not quite sure how to best go about it. Also, I believe your composer package needs to be deactivated, so as not to validate security credentials?

I ask because I'm getting the following error when running unit tests:

Aws\Exception\CredentialsException: Error retrieving credentials from the instance profile metadata service. (Client error: `GET http://169.254.169.254/latest/meta-data/iam/security-credentials/` resulted in a `404 Not Found` response:
not found
)

What do you recommend?

My thoughts on this would be to disable the loading of the package in the service provider if the broadcast driver is not set to laravel-echo-api-gateway. I'd be happy to write up a PR if that route makes sense to you.