Skip to content

Port Leases

Port leases allow you to utilize our proxy services to connect to any TCP service, such as a database, without your database drivers needing to support SOCKS5 or deploying your service with any extra software.


Language specific client libraries are coming soon, for now we will utilize the JSON API.

Creating a port lease

Let's say we wanted to connect to a MySQL database using a proxy, but we there is no support for SOCKS5. We can request a port lease using Noble IP's Lease API.

import fetch from 'node-fetch';
import mysql from require('mysql');

const mysqlHost = '';
const mysqlPort = 3306;

const lease = await fetch("", {
  method: "POST",
  headers: {
    "Content-Type": "application/json; charset=utf-8"
  body: JSON.stringify({
    target_host: mysqlHost,
    target_port: mysqlPort,
    proxy_token: 'fp_NOBLETOKEN',

// MySQL database configuration
const connection = mysql.createConnection({
  host: lease.hostname,
  port: lease.port,
  user: 'your_username',
  password: 'your_password',
  database: 'your_database'

// Establish the connection
connection.connect((error) => {
  if (error) {
    console.error('Error connecting to the database: ', error);
  console.log('Connected to the MySQL database.');
import mysql.connector
import requests

lease ="", json={
    "target_host": "",
    "target_port": 3306,
    "proxy_token": 'fp_PROXYTOKEN',

# MySQL database configuration
config = {
  'host': lease['hostname'],
  'port': lease['port'],
  'user': 'your_username',
  'password': 'your_password',
  'database': 'your_database'

# Establish the connection
connection = mysql.connector.connect(**config)

if connection.is_connected():
    print('Connected to the MySQL database.')
    print('Failed to connect to the MySQL database.')
require 'mysql2'
require 'net/http'
require 'json'

url = URI.parse('')
data = { 'target_host' => '', 'target_port' => 3306, 'proxy_token' => 'fp_NOBLETOKEN' }

http =, url.port)
http.use_ssl = true

request =
request.body = data.to_json
request['Content-Type'] = 'application/json'

response = http.request(request)
lease = JSON.parse(response.body)

# MySQL database configuration
client =
  host: lease.hostname,
  port: lease.port
  username: 'your_username',
  password: 'your_password',
  database: 'your_database'

# Establish the connection
if client
  puts 'Connected to the MySQL database.'
  puts 'Failed to connect to the MySQL database.'