Debugging complex network communications using streams and lando:
Streams comes with a lando configuration file which by default creates a single local server container called 'streams' located at 'streams.lndo.site' which provides a development environment including streams, phpmyadmin and mailhog (to catch and display email notifications). If you are doing testing of federation components across servers, the setup requires a couple of minor changes. Let's say you want to test communications across two servers called 'alice' and 'bob'.
First clone the software repository to two folders:
git clone git@codeberg.org:streams/streams.git alice
git clone git@codeberg.org:streams/streams.git bob
In the first folder (alice), create a lando over-ride file called ".lando.local.yml". Inside it, put these lines to over-ride the default container name:
name: alice
proxy:
mailservice:
- alicemail.lndo.site
Then create a similar entry for 'bob' in that copy of the repository:
name: bob
proxy:
mailservice:
- bobmail.lndo.site
Now you can run 'lando start' in each and have two independent servers with separate development stacks. One will be at
https://alice.lndo.site and the other at
https://bob.lndo.site .
Xdebug may get a bit confused because it only uses one port, so if you wish to use step debugging in your editor/IDE you can issue
lando xdebug-off
or
lando xdebug-on
to disable or enable debugging on either container. You might want to create a small bash script to toggle the active xdebug container as needed.
These containers will be able to access and retrieve federated services on the internet, but they resolve to 'localhost' so you will not be able to connect with or access these sites and site members from external servers.
Enjoy