有这样的一个需求:
树莓派上有一个 GPS 模块, 可以实时发送经纬度坐标到 Web(URL 假设是http://example.com/update-location.php, 频率可能是 3 秒 /次)
Web 上有一张地图(URL 假设是http://example.com/index.php), 有一个使用了 SSE(Sever-Sent Event)协议的页面(URL 假设是http://example.com/get-location.php), 其中index.php在页面加载时和get-location建立了连接, 因此可以不断推送由update-location.php传送来的坐标数据.
那么问题来了, 怎么将update-location.php中的数据 -> get-location.php呀? 最理想的状况时不需要存储, 直接将update-location.php推送到get-location.php.