Architecture Overview
Public WebSocket for browsers. Internal WebSocket for your backend worker. OwnWire routes messages by session_id.
Add zero-trust encryption to your web messaging infrastructure. Maintain complete message privacy even behind CDNs, load balancers, and reverse proxies. Your data stays encrypted end-to-end—no exceptions.
<script src="https://ownwire.yourwebsite.com/js/ownwire.js"></script>
let ownwire = new Ownwire("wss://ownwire.yourwebsite.com/ws");
ownwire.onMessage = (msg) => console.log("received:", msg);
ownwire.connect();
ownwire.send("Hello from the browser");
Public WebSocket for browsers. Internal WebSocket for your backend worker. OwnWire routes messages by session_id.
<script src="https://ownwire.yourwebsite.com/js/ownwire_widget.js"></script>
<script>
document.addEventListener("DOMContentLoaded", () => {
ownwireWidget({
ws_url: "wss://ownwire.yourwebsite.com/ws",
metadata: "username:user1",
title: "Chat",
widget_origin: "https://ownwire.yourwebsite.com",
widget_path: "/",
minimized_mode: "icon"
});
});
</script>
Encrypted browser WS + internal client delivery
Encrypted browser WS + internal client delivery
{
"content": "... message text ...",
"session_id": "UUID string",
"metadata": "optional metadata string"
}
Useful when you want TLS termination, a stable public origin, and a single entry point for both your site and OwnWire. Your proxy can handle certificates and routing, while OwnWire still keeps message contents end-to-end encrypted.
server {
listen 443 ssl http2;
server_name ownwire.yourwebsite.com;
ssl_certificate /etc/letsencrypt/live/ownwire.yourwebsite.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/ownwire.yourwebsite.com/privkey.pem;
# Optional: serve widget/js from nginx as well
location /js/ {
proxy_pass http://127.0.0.1:8080;
}
# Public WebSocket endpoint (browser/widget)
location /ws {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_read_timeout 1h;
}
}