Urgent.News

What's breaking now, across thousands of outlets.

Tech

Why Traccar's WebSocket needs a proxy, and how to set one up with nginx

You have Traccar running, the REST API answers, and now you want a custom web map that moves vehicles live. You open a WebSocket to /api/socket , and it fails. Or it connects from Traccar's own UI but never from your page. This isn't a bug in your code. It comes from two design choices in Traccar, and once you see them, the fix is a short nginx config. The two problems 1. The WebSocket only…

Traccar's WebSocket requires a proxy due to two design choices in the software. Firstly, the WebSocket only accepts a session cookie for authentication, which cannot be added to a WebSocket connection in the browser. Secondly, Traccar does not send any CORS headers by default, causing cross-origin requests to be blocked by the browser.

To solve these issues, set up a reverse proxy using nginx. This proxy serves the frontend files and forwards API requests to Traccar, allowing the browser to automatically send the session cookie and eliminating the need for CORS headers. Implementing this configuration involves updating the nginx configuration file with specific proxy settings and ensuring the frontend and Traccar services are accessible through the proxy.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Scoped Supabase tokens: limit what your app’s agent can change

A personal access token can give a coding agent, CI job, or MCP server access to Supabase projects. The risk is easy to miss: a classic token follows the account’s access, including access to…

  • Scoped personal access tokens limit app agent's actions in Supabase
  • Developers select specific organizations, projects, and permissions for tokens
  • Scoped tokens cannot grant more access than the user originally had

I built MeshLive: video calling and live broadcasting over Bluetooth mesh, without internet (Open source)

A few weeks ago, during the student protests in Delhi, I saw how mobile internet was shut down and how the government even tried to get Bitchat's GitHub repositories taken down, although they remained…

  • MeshLive enables video calling and live broadcasting over Bluetooth mesh without internet
  • Features include live camera, multi-hop relaying, two-way voice and video calls
  • App operates without accounts, backend servers, mobile data, or Wi-Fi requirements

How to Monetize Data as a Solo Dev: The Three Product Shapes That Actually Sell

Solo developers ask me how to monetize data. They picture a dataset on a marketplace, a price tag, passive income. That picture is why most data products fail: they sell the pile, and nobody buys…

  • Solo developers often misunderstand data monetization by selling entire datasets.
  • Three successful product shapes: monitoring as a service, subscription revenue, and one-off answers.
  • Position product based on value, not data collection cost; incorporate recurring element.

More from Saturday 10 October →