There's not way to do it, but you should be able to filter it in your external service if you want.
Comapny1 server is not allowed to share all data (private cars) with Company2/secondary server, so this scenario is not useable.
But thanks for answear!
Who said that filtering should happen on the second server? It can be done before passing it to the other server.
You mean something like Traccar will forward all to ~127.0.0.1/filter.php , which I script to forward data to second server, if ID is right?
Is that the "external service" what you mentioned?
Thanks
Yes, something like that.
Inspiration for another users, how I solve it:
<?php
/*
traccar.xml:
<entry key='forward.enable'>true</entry>
<entry key='forward.url'>http://your_url.ltd/traccarproxy/?id={uniqueId}&lat={latitude}&lon={longitude}&timestamp={deviceTime}&hdop={accuracy}&alt={altitude}&speed={speed}</entry>
*/
//validity check
if (isset($_GET['id']) && isset($_GET['lat']) && isset($_GET['lon'])) {
$id = $_GET['id'];
$lat = $_GET['lat'];
$lon = $_GET['lon'];
$alt = $_GET['alt'];
if ($alt < 1) $alt="1";
$timestamp = $_GET['timestamp'];
$hdop = $_GET['hdop'];
$speed = $_GET['speed'];
if ($id == '728666554') // Car1
{
$targetUrl = "http://url.ltd/get/?latitude={$lat}&longitude={$lon}&altitude={$alt}&id={$id}";
$content = file_get_contents($targetUrl);
exit();
}
if ($id == '780111222') // Car2
{
$targetUrl = "http://url.ltd/get/?latitude={$lat}&longitude={$lon}&altitude={$alt}&id={$id}";
$content = file_get_contents($targetUrl);
exit();
}
}
?>
Hi, I found way how to forward incomming GPS data from one server to anothe server.
But it seems that it forward all incoming traffic.
Is it possible to "filter" forwarding just for one ID?
I mean forwarding just one car.