How Cross-Geography P2P Works
Direct P2P connection between New York and London. No central server proxies the data — encrypted end-to-end between nodes.
Why Cross-Geography Matters
Traditional API marketplaces route every call through a central server. That server becomes a bottleneck, a single point of failure, and a data surveillance point. Opsalis eliminates the middleman: consumer and owner establish a direct encrypted P2P connection, regardless of where they are in the world.
In this demo, the API owner runs on NYC in New York, US (node-a.demo.opsalis.com), and the consumer runs in London, UK (node-b.demo.opsalis.com). Despite crossing 1,500+ kilometers and international borders, API calls complete in under 100ms — because there's no third-party server adding latency in the middle.
This architecture is ideal for latency-sensitive applications (trading, IoT, gaming), data sovereignty requirements (data never touches a third country), and enterprise deployments where compliance mandates direct data flows between known endpoints.
Live Demo — Run All 6 Protocols Across Borders
Multi-Protocol Latency Test
Run all 6 protocol APIs simultaneously from London to New York. See real latencies for each protocol on the map.
Code Samples
# Call REST API — New York to London via P2P
$ curl -w "\nLatency: %{time_total}s\n" \
-X POST https://opsalis.com/api/demo/api/bb-webhook-receiver \
-H "Content-Type: application/json" \
-H "X-Consumer-Key: demo-public-key-2026" \
-d '{"action": "getStatus"}'
# Run all 6 protocols in parallel
$ for api in bb-webhook-receiver bb-graphql bb-soap bb-xmlrpc bb-sse-ticker bb-jsonrpc; do
curl -s -o /dev/null -w "$api: %{time_total}s\n" \
-X POST https://opsalis.com/api/demo/api/$api \
-H "Content-Type: application/json" \
-d '{}' &
done
wait
// JavaScript — parallel cross-geography calls
const protocols = [
{ name: 'REST', api: 'api/bb-webhook-receiver', body: { action: 'getStatus' } },
{ name: 'GraphQL', api: 'api/bb-graphql', body: { query: '{ users { id } }' } },
{ name: 'SOAP', api: 'api/bb-soap', body: { operation: 'getBalance' } },
{ name: 'XML-RPC', api: 'api/bb-xmlrpc', body: { method: 'wp.getPost', id: 1 } },
{ name: 'SSE', api: 'api/bb-sse-ticker', body: { symbol: 'AAPL' } },
{ name: 'JSON-RPC',api: 'api/bb-jsonrpc', body: { method: 'getBlock', params: [] } }
];
const results = await Promise.all(
protocols.map(async (p) => {
const start = performance.now();
const res = await fetch('/api/demo/' + p.api, {
method: 'POST',
headers: { 'Content-Type': 'application/json', 'X-Consumer-Key': 'demo-public-key-2026' },
body: JSON.stringify(p.body)
});
return { name: p.name, latency: Math.round(performance.now() - start), status: res.status };
})
);
results.forEach(r => console.log(`${r.name}: ${r.latency}ms (HTTP ${r.status})`));
# Python — parallel cross-geography latency test
import asyncio
import aiohttp
import time
protocols = [
("REST", "api/bb-webhook-receiver", {"action": "getStatus"}),
("GraphQL", "api/bb-graphql", {"query": "{ users { id } }"}),
("SOAP", "api/bb-soap", {"operation": "getBalance"}),
("XML-RPC", "api/bb-xmlrpc", {"method": "wp.getPost", "id": 1}),
("SSE", "api/bb-sse-ticker", {"symbol": "AAPL"}),
("JSON-RPC", "api/bb-jsonrpc", {"method": "getBlock", "params": []}),
]
async def call(session, name, api, body):
start = time.monotonic()
async with session.post(
f"https://opsalis.com/api/demo/{api}",
json=body,
headers={"X-Consumer-Key": "demo-public-key-2026"}
) as resp:
ms = round((time.monotonic() - start) * 1000)
return f"{name}: {ms}ms (HTTP {resp.status})"
async def main():
async with aiohttp.ClientSession() as s:
tasks = [call(s, *p) for p in protocols]
for result in await asyncio.gather(*tasks):
print(result)
asyncio.run(main())
Deploy Globally in Minutes
Pull the Opsalis Docker Container
Run on any server, anywhere in the world. Each node is independent — no central coordinator required.
$ docker pull opsalis/control-center:latest
$ docker run -d --name opsalis -p 3000:3000 opsalis/control-center:latest
Register Your APIs (Owner Node)
On the owner node, register your API endpoints with pricing and protocol configuration.
# In the control center: APIs → Register New API
# Set endpoint, protocol, price per call, and auth method
Subscribe from Any Geography (Consumer Node)
The consumer node can be anywhere. P2P connections are established automatically — no VPN, no firewall rules, no port forwarding needed.
$ curl -X POST https://your-consumer:3006/subscribe \
-d '{"apiId": "target-api", "ownerNode": "node-a.demo.opsalis.com"}'
Monitor Latency
The control center dashboard shows real-time latency metrics per API, per geography. Identify slow routes and optimize placement.