Hübriid Interneti Juurdepääs
Take full control by hosting your own Internet Gateway for enhanced privacy, security, and customization.
Powered by Advanced Technology
3 Interneti Uplink Teed
Otse Mobiilne / Wi-Fi
Mesh-võrgus olevad nutitelefonid saavad turvaliselt jagada oma aktiivseid mobiilside- või Wi-Fi-ühendusi võrguväliste sõlmedega.
Gateway Pro Uplink
Wi-Fi-ga ühendatud Gateway Pro seadmed võivad toimida kogu kohaliku mesh-võrgu jaoks spetsiaalsete internetisildadena.
Pöörd-Tethering
Internetiühendusega telefon saab BLE kaudu Pöörd-Tethering'i abil ühenduda Gateway Lite'iga, võimaldades Lite'il levitada interneti juurdepääsu LoRa kaudu.
Why Host Your Own Gateway?
Full Control
Complete control over your gateway infrastructure and data flow. You decide who connects.
Enhanced Privacy
Your data stays on your servers. No third-party dependencies or hidden logging.
Custom Configuration
Customize gateway settings, bandwidth limits, and features to your specific needs.
No Subscription
No monthly fees for the software. You only pay for your own server infrastructure.
No Dependencies
Operational independence. Your gateway works even if other parts of the internet are down.
System Requirements
Recommended: 2 CPU Cores, 2GB RAM, 20GB NVMe Storage
Documentation & Guides
Step-by-step instructions to deploy your own MOSA Internet Gateway on a Linux server.
1 Understanding the Architecture
The MOSA Messenger does not care what programming language your server uses. Whether you build it in Node.js, Python, Go, or PHP—your gateway merely needs to expose the exact REST API endpoints and accept WebSocket frames in the specific JSON structures defined below.
2 Implementing the Status API
The first thing the app does is ping your server to verify it's a valid gateway and negotiate the WebSocket endpoint.
app.get('/api/v1/gateway/status', (req, res) => {
res.json({
status: 'online',
version: '1.0',
capabilities: {
websocket_enabled: true,
websocket_url: 'wss://gateway.yourdomain.com/ws'
}
});
});
3 Device Registration
When a new device connects, it will hit your `/api/v1/auth/register` endpoint with its Cryptographic Public Key. Your server must generate a unique API Key for that device and return it.
app.post('/api/v1/auth/register', (req, res) => {
const { device_id, public_key } = req.body;
const apiKey = generateSecureApiKey(); // e.g., crypto.randomBytes(32)
// Save to Database: [device_id, public_key, apiKey]
res.json({ api_key: apiKey });
});
4 Real-Time WebSocket Server (Node.js Example)
WebSockets are crucial for instant message delivery without draining battery life. Here is a basic implementation using the popular `ws` library in Node.js showing how to authenticate the app's initial payload and handle routing.
const WebSocket = require('ws');
const wss = new WebSocket.Server({ port: 8080 });
wss.on('connection', function connection(ws) {
let isAuthenticated = false;
let deviceId = null;
ws.on('message', function incoming(data) {
const payload = JSON.parse(data);
// 1. Handle Authentication Frame
if (payload.type === 'auth') {
const user = verifyTokenInDatabase(payload.token);
if (user) {
isAuthenticated = true;
deviceId = user.device_id;
ws.send(JSON.stringify({ type: 'auth_success' }));
} else {
ws.close();
}
return;
}
// Require auth for all other frames
if (!isAuthenticated) return;
// 2. Handle Message Routing
if (payload.type === 'message') {
// Look up recipient's WebSocket connection and forward
const recipientWs = activeConnections.get(payload.recipient_id);
if (recipientWs) {
recipientWs.send(JSON.stringify(payload));
}
}
});
});
5 Handling Media and File Chunks
For files smaller than 5MB, the app will hit `POST /api/v1/files/send`. For larger files, it will utilize `POST /api/v1/files/chunk` to upload the payload in fragments. Voice message streams (`audio_stream`) are pushed directly over the WebSocket.
// File Chunking Logic
app.post('/api/v1/files/chunk', (req, res) => {
const { message_id, chunk_index, total_chunks, chunk_data, is_last } = req.body;
// Append base64 chunk_data to temp file
appendChunkToTempFile(message_id, chunk_data);
if (is_last) {
assembleAndSaveFinalFile(message_id, total_chunks);
}
res.json({ success: true, chunk_index });
});
Setup Complete!
Your custom Internet Gateway is now successfully running. You can point your MOSA companion applications to https://gateway.yourdomain.com to start routing messages through your own secure infrastructure.
Custom Gateway App API Specification
Build your own gateway software (e.g. Node.js, Python, Go) that the MOSA Messenger app can natively connect to. Your server must accept the following strict JSON payloads and HTTP signatures exactly as defined below.
Required HTTP Headers
Every incoming request from the messenger app expects your server to accept and enforce specific headers.
- Content-Type: application/json
- Accept: application/json
- X-MOSA-Timestamp: <unix_timestamp>
- Authorization: Bearer <API_KEY> (except for status and registration)
1. Gateway Status API
GETThe app calls this to check server health and negotiate WebSocket capabilities.
2. Device Registration API
POSTApp registers its cryptographic identity. Expects { "api_key": "YOUR_KEY" } in return.
3. Send Message API
POSTApp pushes an encrypted message payload to a specific recipient through your gateway.
4. Polling Messages API
GETIf WebSockets fail, the app polls for pending messages.
Map the app's User ID to their pending message queue on your DB.
File Transfer APIs
The app sends small files entirely, and chunks files over 5MB. Implement these endpoints to receive media.
- POST POST /api/v1/files/send - used for files < 5MB using 'file_data' in Base64.
- POST POST /api/v1/files/chunk - utilizes 'chunk_index', 'total_chunks', and 'is_last'.
WebSocket Real-Time Delivery Protocol
The app maintains a persistent WebSocket connection to your server for battery-efficient real-time delivery.
The app connects to the URI provided in your 'Gateway Status' response capabilities array under 'websocket_url'.
A. Authentication Frame
App sends a token frame. Your server must respond with {"type": "auth_success"}.
{"type": "auth", "token": "<API_KEY>"}
B. Real-Time Routing
Server pushes incoming messages directly into the client socket.
{"type": "message", "message_id": "...", "sender_id": "..."}
C. Media Streams
Your server must handle forwarding 'audio_stream' continuous chunks and 'video_signal' WebRTC signaling frames.
Don't Want to Self-Host?
Kasuta meie ametlikku Internet Gateway'i aadressil gateway.talivio.com. Täielikult hallatud, turvaline ja alati ajakohane. Märkus: gateway-seansid on opt-in ja katkevad turvalisuse ja privaatsuse tagamiseks automaatselt 30 minuti pärast.
Need a higher rate limit? Contact [email protected] for custom quotas.
Use Official Gateway