Skip to content
Alexey Kadyrov edited this page Dec 14, 2018 · 1 revision

Overview

"Hybrid Port Bridge" is a point-to-point tunneling utility that allows mapping TCP listener ports from a machine on network A to another machine on a different network B, and make it appear as if the listener were local on network B.

The utility is based on the original sample from Microsoft found here: https://github.com/Azure/azure-relay/tree/master/samples/hybrid-connections/dotnet/portbridge

Hybrid Port Bridge is similar to what can generally be achieved via SSH tunneling, but is realized over the Relay so that both parties can reside safely behind Firewalls, leverage the Service Bus authorization integration, and have all communication run over the Firewall-friendly WebSocket protocol over port 443, see https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-hybrid-connections-protocol#protocol-reference

How it works

Hybrid Port Bridge consists of two components, the "Port Bridge Service Agent" and the "Port Bridge Client Agent".

The Client Agent’s job is to listen for and accept TCP on a configurable port. The Service Agent’s job is to accept for incoming connections from the Client Agent, establish a connection with the Client Agent, and pump the data from the Client Agent to the actual listening service – and vice versa.

How it works

In the picture above you see that the Service Agent is configured to connect to a SQL Server listening at the SQL Server default port 1433 and that the Client Agent – running on a different machine, is listening on port 1433 as well, thus mapping the remote SQL Server onto the Client Agent machine as if it ran there. You can (and I think of that as to be more common) map the service on the Agent to any port you like – say higher up at 41433.

In order to increase the responsiveness and throughput for protocols that are happy to kill and reestablish connections frequently such as HTTP, "Hybrid Port Bridge" always multiplexes concurrent socket connections between two parties over the same relayed connection.