# ProxyMarket Connector: Sell Your Proxies Without Code

> For AI tools: this is the Markdown copy of https://xproxy.io/document/proxymarket-connector. Every XProxy guide has one at its URL + `.md`; the index of all guides is https://xproxy.io/llms.txt.

Sell proxies from your own servers on ProxyMarket without code: install pm-connector, give it one small script that adds and deletes a login, add your plans and go live.

You already sell proxies from your own servers. `pm-connector` is a small program that lets [ProxyMarket](https://market.xproxy.io) sell them for you. When a customer pays, it lets that customer into your proxy. When the rental ends, it shuts them out again. You do not need a domain or an open port for it.

**You need:** a vendor account on market.xproxy.io, a Linux or Windows server that can reach your proxy panel or your proxy's password file, and proxies that customers can reach from the internet.

## How does it work?

When you sell a proxy by hand, you do two things: you make a username and password for the buyer, and you delete them when the rental is over. The connector does the same for every order, through **one script of yours**:

```
1. A customer buys your plan "US T-Mobile, 30 days"
   (your proxy: 203.0.113.5, port 31001).

2. The connector makes up a login for this customer:
       username   pm_9b1c2d3e4f506172
       password   k7m2xq4wyhn3bt5d

3. It runs YOUR script and tells it to add that login:
       python3 panel.py create
           PM_USERNAME = pm_9b1c2d3e4f506172
           PM_PASSWORD = k7m2xq4wyhn3bt5d
           PM_PORT     = 31001

4. The customer gets 203.0.113.5:31001 with that username and password.

5. 30 days later it runs YOUR script again, to delete the login:
       python3 panel.py delete
           PM_USERNAME = pm_9b1c2d3e4f506172
```

You never choose a customer's username or password: the connector makes them up and hands them to your script. Customer traffic never passes through the connector or ProxyMarket; customers connect straight to your proxy.

## How do I start selling?

1. **Install the connector** on a server that can reach your proxy panel or your proxy's password file.

   **Linux**

   ```bash
   curl -fsSL https://x-proxy.io/pm-connector/install.sh | sh
   pm-connector version
   ```

   For Linux on Intel/AMD (amd64) and ARM (arm64, armv7) servers and boxes. The script checks the download and puts `pm-connector` in `/usr/local/bin`.

   **Windows**

   ```
   # PowerShell as Administrator:
   irm https://x-proxy.io/pm-connector/install.ps1 | iex
   pm-connector version
   ```

   For 64-bit Windows. It checks the download, installs to `%ProgramFiles%\pm-connector` and adds it to PATH.

   **Docker**

   ```bash
   # Dockerfile (add python3 or nodejs to "apk add" if your script needs it)
   FROM alpine:3
   RUN apk add --no-cache curl ca-certificates \
    && curl -fsSL https://x-proxy.io/pm-connector/install.sh | sh
   WORKDIR /config
   ENTRYPOINT ["pm-connector"]
   CMD ["run"]

   # build it, then set it up in the folder that will hold config.yaml:
   #   docker build -t pm-connector .
   #   docker run --rm -it -v "$PWD":/config pm-connector init
   ```

   The container must be able to run your script and reach your panel. Keep the `/config` folder: it holds `config.yaml`, your script and the list of logins the connector made.
2. **Run `pm-connector init`.** It asks one question: can ProxyMarket reach this server from the internet? ProxyMarket needs that to send you orders, to end them, and for the customer's **Change IP** button.

   - **No, or not sure** (recommended). You open nothing. The connector connects out to ProxyMarket and everything arrives through that connection. It works behind any router, NAT or 4G line. Key to create: **ProxyMarket hook**.
   - **Yes.** You forward one port on your router to this server, or point your own public address at it ([how](#public-url)). Key to create: **Custom webhook (your server)**.

   Then it tells you which key to create in the [Vendor Dashboard](https://market.xproxy.io/vendor) under **API Keys → New key**. Paste the key when asked: it is shown only once.

   ```bash
   $ pm-connector init
   pm-connector 1.0.0 setup: writes config.yaml

   ProxyMarket has to reach this server: to send you orders, to end them,
   and when a customer presses "Change IP".

   You already open your proxy ports to the internet. Can you open one more
   for ProxyMarket (port forwarding / NAT on your router, or a public address)?
     1) No, or not sure (recommended)
        Nothing to open. The connector connects out to ProxyMarket and
        everything arrives through that connection.
     2) Yes, I will forward a port or use my own public address
   Choose [1]: 1

   Create your key: Vendor Dashboard > API Keys > New key > "ProxyMarket hook"
   Paste it here: pm_live_3f9c...
   ✅ Key accepted. Connected to ProxyMarket. No port was opened.

   ✅ Wrote config.yaml
   Next:
     1. Write your script, in any language, or start from a ready one:
          pm-connector sample          (shows the list: python, node, php, 3proxy)
     2. pm-connector test
     3. sudo pm-connector service install
   ```
3. **Write your script, or start from a ready one.** The connector runs one program of yours for every order. It can be in **any language**, with any name, in any folder: you only tell the connector the command that starts it. These ready scripts are starting points; change them as you like, or write your own from scratch.

   **Python: for a panel with an API**

   ```
   #!/usr/bin/env python3
   # pm-connector script for a panel that has an API.
   # Python 3, nothing else to install. Change the lines marked CHANGE.
   import json
   import os
   import sys
   import urllib.error
   import urllib.request

   PANEL = "http://127.0.0.1:9000"   # CHANGE: your panel's address
   TOKEN = "YOUR_PANEL_TOKEN"        # CHANGE: your panel's API token

   def value(name):
       """What the connector passes for this order, for example value("USERNAME")."""
       return os.environ.get("PM_" + name, "")

   def call(method, path, body=None):
       req = urllib.request.Request(
           PANEL + path,
           method=method,
           data=None if body is None else json.dumps(body).encode(),
           headers={"Authorization": "Bearer " + TOKEN, "Content-Type": "application/json"},
       )
       with urllib.request.urlopen(req, timeout=20) as res:   # an error from the panel stops the script
           text = res.read().decode()
       return json.loads(text) if text else None

   def create():       # CHANGE: how your panel adds a login
       call("POST", "/api/users", {"username": value("USERNAME"), "password": value("PASSWORD"), "port": int(value("PORT"))})

   def delete():       # CHANGE: how your panel deletes a login
       try:
           call("DELETE", "/api/users/" + value("USERNAME"))
       except urllib.error.HTTPError as err:
           if err.code != 404:       # already deleted is fine
               raise

   def rotate():       # OPTIONAL: change the IP of the modem on this port, print the new IP
       print(call("POST", "/api/modems/" + value("PORT") + "/rotate")["ip"])

   def whitelist():    # OPTIONAL: only these IPs may use the customer's login
       ips = [ip for ip in value("IP_WHITELIST").split(",") if ip]
       call("PUT", "/api/users/" + value("USERNAME") + "/whitelist", {"ips": ips})

   def list_logins():  # OPTIONAL: print the logins that exist, one per line
       for user in call("GET", "/api/users")["data"]:
           print(user["username"])

   # Delete an OPTIONAL action here too if your panel cannot do it.
   ACTIONS = {"create": create, "delete": delete, "rotate": rotate, "whitelist": whitelist, "list": list_logins}

   action = sys.argv[1] if len(sys.argv) > 1 else ""
   if action == "actions":
       print("\n".join(ACTIONS))
   elif action in ACTIONS:
       ACTIONS[action]()
   else:
       sys.exit("unknown action: " + action)
   ```

   `pm-connector sample python` writes this file next to `config.yaml` and sets `script: "python3 panel.py"`.

   **Node.js: for a panel with an API**

   ```
   #!/usr/bin/env node
   // pm-connector script for a panel that has an API.
   // Node.js 18 or newer, nothing else to install. Change the lines marked CHANGE.
   const PANEL = 'http://127.0.0.1:9000';   // CHANGE: your panel's address
   const TOKEN = 'YOUR_PANEL_TOKEN';        // CHANGE: your panel's API token

   // What the connector passes for this order, for example value('USERNAME').
   const value = (name) => process.env['PM_' + name] || '';

   async function call(method, path, body) {
     const res = await fetch(PANEL + path, {
       method,
       headers: { Authorization: 'Bearer ' + TOKEN, 'Content-Type': 'application/json' },
       body: body === undefined ? undefined : JSON.stringify(body),
       signal: AbortSignal.timeout(20000),
     });
     if (method === 'DELETE' && res.status === 404) return null;   // already deleted is fine
     const text = await res.text();
     if (!res.ok) throw new Error(method + ' ' + path + ': HTTP ' + res.status + ' ' + text);
     return text ? JSON.parse(text) : null;
   }

   const user = () => '/api/users/' + encodeURIComponent(value('USERNAME'));

   const actions = {
     // CHANGE: how your panel adds and deletes a login
     create: () => call('POST', '/api/users', { username: value('USERNAME'), password: value('PASSWORD'), port: Number(value('PORT')) }),
     delete: () => call('DELETE', user()),
     // OPTIONAL: change the IP of the modem on this port, print the new IP
     rotate: async () => console.log((await call('POST', '/api/modems/' + value('PORT') + '/rotate')).ip),
     // OPTIONAL: only these IPs may use the customer's login
     whitelist: () => call('PUT', user() + '/whitelist', { ips: value('IP_WHITELIST').split(',').filter(Boolean) }),
     // OPTIONAL: print the logins that exist, one per line
     list: async () => (await call('GET', '/api/users')).data.forEach((u) => console.log(u.username)),
   };

   const action = process.argv[2];
   if (action === 'actions') {
     console.log(Object.keys(actions).join('\n'));
   } else if (!actions[action]) {
     console.error('unknown action: ' + action);
     process.exit(2);
   } else {
     actions[action]().catch((err) => {
       console.error(err.message);   // goes to the connector's log
       process.exit(1);
     });
   }
   ```

   `pm-connector sample node` writes this file next to `config.yaml` and sets `script: "node panel.js"`.

   **Shell: for 3proxy**

   ```
   #!/bin/sh
   # pm-connector script for 3proxy, which keeps its logins in a password file.
   # 3proxy.cfg needs:   auth strong   and   users $/etc/3proxy/users.txt
   set -eu
   F=/etc/3proxy/users.txt             # CHANGE: your 3proxy password file

   without_login() { grep -v "^$PM_USERNAME:" "$F" > "$F.tmp" || true; }
   save() { mv "$F.tmp" "$F"; pkill -USR1 3proxy || true; }   # 3proxy reads the file again

   case "${1:-}" in
     create)  without_login; echo "$PM_USERNAME:CL:$PM_PASSWORD" >> "$F.tmp"; save ;;
     delete)  without_login; save ;;
     # OPTIONAL: print the logins that exist, one per line
     list)    cut -d: -f1 "$F" ;;
     # OPTIONAL: change the IP of the modem on this port. Remove the "#", put in your
     # own command, and add "echo rotate" to the actions line below.
     # rotate)  /usr/local/bin/rotate-modem.sh "$PM_PORT" ;;
     actions) echo create; echo delete; echo list ;;
     *)       echo "unknown action: ${1:-}" >&2; exit 2 ;;
   esac
   ```

   `pm-connector sample 3proxy` writes this file next to `config.yaml` and sets `script: "sh 3proxy.sh"`. Any proxy software that keeps its logins in a file works the same way.

   **PHP: the shortest script**

   ```
   <?php
   // pm-connector script in PHP: the shortest script that follows the standard.
   // It has the two needed actions. Change the lines marked CHANGE.
   $PANEL = 'http://127.0.0.1:9000';   // CHANGE: your panel's address
   $TOKEN = 'YOUR_PANEL_TOKEN';        // CHANGE: your panel's API token

   function call($method, $path, $body = null) {
       global $PANEL, $TOKEN;
       $answer = @file_get_contents($PANEL . $path, false, stream_context_create(['http' => [
           'method' => $method,
           'header' => "Authorization: Bearer $TOKEN\r\nContent-Type: application/json\r\n",
           'content' => $body === null ? '' : json_encode($body),
           'timeout' => 20,
           'ignore_errors' => true,
       ]]));
       $status = (int) (explode(' ', $http_response_header[0] ?? '')[1] ?? 0);
       if ($method === 'DELETE' && $status === 404) return;   // already deleted is fine
       if ($status < 200 || $status >= 300) {
           fwrite(STDERR, "$method $path: HTTP $status $answer\n");   // goes to the connector's log
           exit(1);
       }
   }

   $action = $argv[1] ?? '';                 // the action word
   $username = getenv('PM_USERNAME');        // the PM_ values
   if ($action === 'create') {               // CHANGE: how your panel adds a login
       call('POST', '/api/users', ['username' => $username, 'password' => getenv('PM_PASSWORD'), 'port' => (int) getenv('PM_PORT')]);
   } elseif ($action === 'delete') {         // CHANGE: how your panel deletes a login
       call('DELETE', '/api/users/' . rawurlencode($username));
   } else {
       fwrite(STDERR, "unknown action: $action\n");
       exit(2);
   }
   ```

   This is all a script needs: read the action word, read the `PM_` values, end with an error when something went wrong. Write the same in Go, C#, Ruby, PowerShell or anything else your system uses.

   `pm-connector sample python` (or `node`, `php`, `3proxy`) puts a ready script next to `config.yaml`. In it, change the lines marked `CHANGE`: where your panel is, its token, and the two calls that add and delete a login. The parts marked `OPTIONAL` can wait ([what they are for](#optional)).

   Then put the command that starts your script into `config.yaml`. That is the whole file:

   ```
   api_key: "pm_live_3f9c..."
   script: "python3 panel.py"

   # script: is any command that starts YOUR program. For example:
   #   script: "node panel.js"
   #   script: "php /opt/pm/panel.php"
   #   script: "/opt/pm/my-program"                      (Go, Rust, C#: a compiled program)
   #   script: "powershell -File C:\pm\panel.ps1"      (Windows)
   ```

   What the connector expects from a script, whatever the language, is in [the script standard](#standard) below.
4. **Run `pm-connector test`.** It runs your script with a test login: adds it, checks it, deletes it. Fix every ❌ line before you go on ([what they mean](#troubleshooting)).

   ```bash
   $ pm-connector test
   ✅ config.yaml is valid
   ✅ Key accepted by ProxyMarket
   ✅ Connected to ProxyMarket: orders will reach this server
   ✅ Script runs: python3 panel.py (it can: create, delete, rotate, whitelist, list)
   No plans yet. Which of your proxy ports should the test use? 31001
   ✅ create: added the test login pm_test_4f2a
   ✅ list: pm_test_4f2a is there
   ✅ whitelist: set for pm_test_4f2a
   ✅ delete: removed pm_test_4f2a
   ℹ️  rotate was not run, it would change a modem's IP. Try it: pm-connector test --rotate 31001
   ℹ️  No plans use this key yet: add them in Vendor Dashboard > My Plans

   Ready. Keep it running: sudo pm-connector service install
   ```
5. **Keep it running** as a service, so it starts with the server and comes back after a crash.

   **Linux**

   ```bash
   sudo pm-connector service install
   journalctl -u pm-connector -f      # watch the log
   ```

   Starts with the server and restarts if it ever stops.

   **Windows**

   ```
   # PowerShell as Administrator:
   pm-connector service install
   ```

   Registers a Windows service that starts with Windows. The log is `pm-connector.log` next to `config.yaml`.

   **Docker**

   ```bash
   docker run -d --name pm-connector --restart=always -v "$PWD":/config pm-connector
   docker logs -f pm-connector        # watch the log
   ```

   `--restart=always` brings it back after a crash or a reboot.
6. **Add your plans.** A plan is one thing a customer can buy. In the Vendor Dashboard open **My Plans → New plan** and enter its name, country, price, how long it lasts, and the proxy IP and port customers connect to. Set **API Key / Server** to your key. [What each field means](#plans).
7. **Send yourself a test order.** In **Integration Status** press **Send test order**. It is free, hidden from customers and ends by itself after 10 minutes. You see each step turn ✅: order sent, login added, login works, login deleted. All green means you are on sale.

## The script standard: what must my script do?

This is the whole interface between the connector and your script: **one word** on the command line, the order details as **`PM_` values**, and **how the script ends**. There are no other arguments, nothing to install and nothing to import, so it works in any language. The ready scripts already follow it.

You can run your script by hand exactly the way the connector does:

```bash
# Linux: add a test login, look in your panel, then delete it
PM_USERNAME=pm_test PM_PASSWORD=secret123 PM_PORT=31001 python3 panel.py create
PM_USERNAME=pm_test python3 panel.py delete

# Windows PowerShell
$env:PM_USERNAME="pm_test"; $env:PM_PASSWORD="secret123"; $env:PM_PORT="31001"
python panel.py create
python panel.py delete
```

### 1. It is run with one word: the action

The connector runs the command in `script:` and adds one word that says what to do, for example `python3 panel.py create`.

| Action | When the connector runs it | What your script does | Needed? |
| --- | --- | --- | --- |
| `create` | A customer paid | Adds the login `PM_USERNAME` / `PM_PASSWORD` | Needed |
| `delete` | The rental ended, or the order was cancelled or refunded | Deletes the login `PM_USERNAME`. Already deleted counts as done | Needed |
| `rotate` | The customer pressed **Change IP** | Changes the IP of the modem on `PM_PORT`. It may print the new IP | Optional |
| `whitelist` | The customer set which IPs may use the proxy | Lets only the IPs in `PM_IP_WHITELIST` use that login | Optional |
| `list` | Clean-up, for example after you reinstall the connector | Prints the logins that exist, one per line | Optional |
| `actions` | When the connector starts | Prints the actions it has, one per line. Without it the connector uses only `create` and `delete` | For optional actions |

### 2. It reads the order from PM_ values

The connector passes the details as environment variables: named values every language can read. In shell `$PM_USERNAME`, in Python `os.environ["PM_USERNAME"]`, in Node.js `process.env.PM_USERNAME`, in PowerShell `$env:PM_USERNAME`.

| Value | For example | Where it comes from |
| --- | --- | --- |
| `PM_USERNAME` | `pm_9b1c2d3e4f506172` | The connector makes it up, new for every order. It always starts with `pm_` |
| `PM_PASSWORD` | `k7m2xq4wyhn3bt5d` | The connector makes it up, new for every order |
| `PM_PORT` | `31001` | The **Proxy Port** you typed on the plan the customer bought. It tells your system which modem or port was sold |
| `PM_HOST` | `203.0.113.5` | The **Proxy IP** you typed on that plan |
| `PM_PLAN` | `modem-7` | **Your ID** on that plan, if you filled it in |
| `PM_ORDER_ID`, `PM_EXPIRES_AT` | the order number and its end time | The order on ProxyMarket |
| `PM_IP_WHITELIST` | `198.51.100.7,198.51.100.8` | Only for `whitelist`: the IPs the customer allows, separated by commas. Empty means everyone |

Which values each action gets:

| Action | Values |
| --- | --- |
| `create` | `PM_USERNAME`, `PM_PASSWORD`, `PM_PORT`, `PM_HOST`, `PM_PLAN`, `PM_ORDER_ID`, `PM_EXPIRES_AT` |
| `delete` | `PM_USERNAME`, `PM_PORT`, `PM_HOST`, `PM_PLAN`, `PM_ORDER_ID` |
| `rotate` | `PM_PORT`, `PM_HOST`, `PM_PLAN`, `PM_USERNAME`, `PM_ORDER_ID` |
| `whitelist` | `PM_USERNAME`, `PM_IP_WHITELIST`, `PM_PORT`, `PM_ORDER_ID` |
| `list`, `actions` | none |

### 3. It says whether it worked

- **Worked:** the script ends normally (exit code 0).
- **Failed:** the script ends with an error (any other exit code) and prints why. The connector shows that text in its log and in **Integration Status**. A failed `create` gives the customer their money back.
- Each run may take up to 120 seconds. The connector runs one action at a time, so your script needs no locking.

### 4. If it has something to tell, it prints one line

Most scripts print nothing. Only when your system decides something the connector cannot know, `create` prints it as one line of JSON, the last line it prints:

```
{"host": "203.0.113.5", "port": 31007}              you picked the modem yourself
{"username": "u8821", "password": "x7Kq2m"}         your panel made its own login
{"vpn_config": "...the whole config..."}            a VPN plan: this customer's config
```

### Optional: Change IP, IP whitelist, clean-up

The Python, Node.js and shell scripts already contain these actions. Keep the ones your system can do and delete the others; the connector asks your script which ones it has. In a script of your own, add them the same way.

**Python**

```
def rotate():       # OPTIONAL: change the IP of the modem on this port, print the new IP
    print(call("POST", "/api/modems/" + value("PORT") + "/rotate")["ip"])

def whitelist():    # OPTIONAL: only these IPs may use the customer's login
    ips = [ip for ip in value("IP_WHITELIST").split(",") if ip]
    call("PUT", "/api/users/" + value("USERNAME") + "/whitelist", {"ips": ips})

def list_logins():  # OPTIONAL: print the logins that exist, one per line
    for user in call("GET", "/api/users")["data"]:
        print(user["username"])
```

**Node.js**

```
  // OPTIONAL: change the IP of the modem on this port, print the new IP
  rotate: async () => console.log((await call('POST', '/api/modems/' + value('PORT') + '/rotate')).ip),
  // OPTIONAL: only these IPs may use the customer's login
  whitelist: () => call('PUT', user() + '/whitelist', { ips: value('IP_WHITELIST').split(',').filter(Boolean) }),
  // OPTIONAL: print the logins that exist, one per line
  list: async () => (await call('GET', '/api/users')).data.forEach((u) => console.log(u.username)),
```

**Shell**

```
  # OPTIONAL: print the logins that exist, one per line
  list)    cut -d: -f1 "$F" ;;
  # OPTIONAL: change the IP of the modem on this port. Remove the "#", put in your
  # own command, and add "echo rotate" to the actions line below.
  # rotate)  /usr/local/bin/rotate-modem.sh "$PM_PORT" ;;
```

- `rotate`: with it, customers get a **Change IP** button and automatic rotation.
- `whitelist`: with it, customers can limit which IPs may use their proxy.
- `list`: with it, the connector also finds and deletes `pm_` logins left behind, for example after you reinstall it. It never touches a login that does not start with `pm_`.

## How do I set up my plans?

A plan is one thing a customer can buy, for example *US T-Mobile 4G, 30 days, $25*. You make plans in **Vendor Dashboard → My Plans** and can change the price or pause a plan there at any time.

| Field | What to enter |
| --- | --- |
| **Name, Country, Proxy Type, Protocol** | What customers see and filter by |
| **Duration, Price** | How long one purchase lasts and what it costs |
| **Stock** | How many customers can use the plan at the same time. Enter `1` for a modem you rent to one person. A sale takes one; it comes back when the order ends |
| **Proxy IP, Proxy Port** | The public address customers connect to. Your script gets them as `PM_HOST` and `PM_PORT` |
| **API Key / Server** | Your connector's key. Orders for this plan go to that connector |
| **Your ID** (optional) | Your own name for it, for example `modem-7`. Your script gets it as `PM_PLAN` |

Leave **Proxy Username**, **Proxy Password** and **Rotation Link** empty: the connector makes a new login for every order.

### I have many modems. One plan each?

- **One plan per modem**, when customers should pick a specific one. Give each plan its own **Proxy Port** and **Stock 1**.
- **One plan for all of them**, when any free modem will do. Set **Stock** to the number of modems and leave **Proxy IP** and **Proxy Port** empty. Your `create` picks a free modem and prints its address: `{"host": "203.0.113.5", "port": 31007}`.

## What can I sell?

- **Proxies:** HTTP, SOCKS5 or both, of any kind (mobile, residential, datacenter, ISP, IPv6). The customer gets your proxy IP and port with the username and password the connector made.
- **VPN:** OpenVPN, WireGuard or VLESS. The customer gets a config file or a `vless://` link instead of a login. On the plan pick **Proxy Type: VPN** and the **VPN Protocol**.

For VPN there are two ways to hand over the config. If every customer of a plan may use the same config, paste it into the plan's **VPN Config** field and your script has nothing to do. If each customer needs their own, your `create` makes it and prints `{"vpn_config": "…the whole config…"}`.

## I answered Yes. How do I open it to ProxyMarket?

ProxyMarket then calls your server directly instead of using the connector's outgoing connection. Pick one:

- **Port forwarding (NAT).** On your router, forward TCP port `8787` to this server, the same way you forward your proxy ports. Your address is `http://YOUR_PUBLIC_IP:8787`. The customer's login still travels encrypted.
- **Your own HTTPS address.** Anything that serves HTTPS and passes requests on to port `8787`: your reverse proxy (Caddy, nginx, IIS), a Cloudflare Tunnel or Tailscale Funnel. Your address is for example `https://pm.example.com`.

`init` writes this into `config.yaml` and starts answering on the port, so ProxyMarket can check it. Then create the key as **Custom webhook (your server)** with your address as **Webhook URL**.

```
api_key: "pm_live_..."          # a "Custom webhook (your server)" key
script: "python3 panel.py"

webhook:
  public_url: "http://203.0.113.5:8787"  # the Webhook URL you typed on the key
  listen: "0.0.0.0:8787"                 # the port you forwarded to this server
```

Not reachable after all? Run `pm-connector init` again and answer **No**. Everything else on this page is the same for both answers.

## What do the test messages mean?

| You see | What to do |
| --- | --- |
| ❌ *Key rejected* | Paste the whole key, starting with `pm_`. If it still fails, the key was deleted or switched off in **API Keys**: make a new one |
| ❌ *This key is not a ProxyMarket hook key* | You answered **No** but pasted a **Custom webhook** key. Make a new key of type **ProxyMarket hook**, or run `init` again and answer **Yes** |
| ❌ *ProxyMarket cannot reach http://…:8787* | You answered **Yes** but the port is not open: check the port forward and the firewall, or run `init` again and answer **No** |
| ❌ *Cannot reach ProxyMarket* | The server needs outgoing HTTPS (port 443) to `market.xproxy.io` and `market-hook-service.xproxy.io`. Check the firewall and DNS |
| ❌ *Script does not run: …* | The command in `script:` could not start: check the path, and that `python3` or `node` is installed |
| ❌ *create failed: …* or *delete failed: …* | The text after the colon is what your script printed, usually your panel's answer. Check the lines marked `CHANGE` (address, token, the two calls) and test again |
| ❌ *list: the test login is not there* | `create` said it worked but the login is missing: check that `create` and `list` use the same panel or file |
| ⚠️ *Proxy IP … does not accept connections* | Customers will not get through: open the port on your firewall or router, or fix **Proxy IP** and **Proxy Port** on the plan |
| *Vendor account not approved yet* | Your key works, but an admin has not approved your vendor account. Message [@xproxyio](https://t.me/xproxyio) with your account email |

After you are on sale, the **Integration Status** tab in the Vendor Dashboard shows whether the connector is connected, which plans are listed or hidden and why, and the last orders with the error of any that failed.

## FAQ

### Who chooses the customer's username and password?

The connector. For every order it makes up a new username (`pm_` and 16 characters) and a 16-character password, and passes them to your script as `PM_USERNAME` and `PM_PASSWORD`. You do not set them anywhere.

### My panel makes its own username and password. Can I use those?

Yes. Let your `create` print them, `{"username": "…", "password": "…"}`, and the customer gets those instead ([rule 4](#answer)).

### Do I need to know how to code?

No. In a ready script you change your panel's address, its token and the two calls that add and delete a login; your panel's API documentation shows those. The **Ask AI** button at the top of this page can do it with you.

### Does it work on Windows?

Yes. The Python, Node.js and PHP scripts are the same on Windows; set for example `script: "python C:\pm\panel.py"`. A PowerShell or `.bat` script works too if it follows [the standard](#standard).

### What if my system is slow, or the connector is off?

Your `create` has 120 seconds. After that the customer gets their money back and the sale is removed from your earnings. The same happens to orders placed while the connector is off. If it stays off for two checks in a row (they run every 10 minutes), your plans are hidden until it is back. Once back, it deletes the logins of orders that ended while it was away.

### I have several servers. One connector for all?

If one panel or script manages all of them, one connector is enough. Otherwise install a connector on each server, with its own key, and set each plan's **API Key / Server** to the key of the server that serves it. One key works with one connector at a time.

### Can I end an order myself?

Yes: `pm-connector expire ORDER_ID` ends the order on ProxyMarket and deletes its login. It does not give the customer money back.

### How do I update the connector?

Run the install command again, then restart the service. Your `config.yaml`, your script and your customers' logins stay as they are.

### I run XProxy. Do I need this?

No. The XProxy panel sells on ProxyMarket by itself: see [Sell with XProxy](https://xproxy.io/document/proxymarket).

## What next?

Open the dashboard to get your key, or see the other ways to sell.

[Vendor Dashboard →](https://market.xproxy.io/vendor) [Sell with XProxy →](https://xproxy.io/document/proxymarket) [Build your own integration →](https://xproxy.io/document/proxymarket-vendor-integration)

---

Source: https://xproxy.io/document/proxymarket-connector
