Split model for CG-NAT connections or using secure tunnels

David Colea year ago

I wonder if there is an appetite for investigating if the TCP Listener for devices could exist somewhere other than where the traccar server lives.

So some sort of listener application that can receive packets from the various devices and forward them to a queue (ActiveMQ, RabbitMq etc) and the traccar server change from using a listener model to connecting (via a tunnel) to the queue to pull the GPS records off.

I realised it's quite an architectural shift but it might be a more cost effective use of a VPS to just listen for packets and dump them on a queue, than to host the entire traccer server and db in the cloud.

Track-tracea year ago

I wonder, a vps to host traccar server on should cost you less then 10$ a month to run traccar server ?

David Colea year ago

yeah probably....but I'm cheaper than that :D
And would have playes with an azure function or oracle arm vm

Track-tracea year ago

If you cant affort Azure etc, then changing to cheap vps seems far more logic then thinking about changing the whole server concept because of costs. Just my two cents..

David Colea year ago

Yeah maybe, but thought it was potentially a good security model as well. As added a layer between the server and the internet.

Anton Tananaeva year ago

Wouldn't you still need to host the "TCP Listener" somewhere?

David Colea year ago

yeah, but it would be a minimal vps, or even an azure work fucntion (I believe that's the only thing that allows a tcp end point.

the fundamental change is allowing for traccar server to pull entries off a queue and well as receive them via tcp. And then some of the mqtt based protocols might make a bit more sense as at the moment they work in the same method where they try and push something at a tcp endpoint? rather than traccar make a connection to an mqtt broker.

Anton Tananaeva year ago

You can just tunnel connection from a minimal VPS to your own local server.

Shawyaa year ago

the only way either you ask your ISP for dedicated IP or use VPS .
Not sure if links are allowed but search "Getting over CGNAT (Wireguard + GCE)" if you have access to GCE it won’t cost you .

also check my post it may interest you .

David Colea year ago

I really don't understand the concept. but does the wireguard tunnel just expose port tcp:5002 at the vps after running through a tunnel? And so no other software is required there?

I've only just started looking at this, and the only other tunnels I have used are via cloudflare. But that's rstricted to http traffic only.

David Colea year ago

So further to this. I did install a version in an oracle cloud VM. But I took it a bit further and via tailscale the oracle cloud vm only had the front end. The DB stayed at home. So I'd removed the need to port forward, and/or get around cg-nat.

As I did find that a little unstable (possible memory issues on the cloud vm), I ended up writing a docker container with a small python script that would listen on a traccar port and forward any packet (via tailscale) to my instance at home. Spin up a new container for a new port.