Skip to main content
POST
/
boxes
/
{boxId}
/
proxy
JavaScript
import GboxSDK from "gbox-sdk";

const gboxSDK = new GboxSDK({
  apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});

async function main() {
  const box = await gboxSDK.create({ type: "android" });

  await box.proxy.set({
    host: "127.0.0.1",
    port: 8080,
    auth: {
      username: "username",
      password: "password"
    }
  });

  console.log("HTTP proxy set successfully");
}

main();
import os
from gbox_sdk import GboxSDK

def main():
gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"]) # This is the default and can be omitted

# Create Android box
box = gbox_sdk.create(type="android")

# Set HTTP proxy
box.proxy.set(
host="127.0.0.1",
port=8080,
auth={
"username": "username",
"password": "password",
},
)

print("HTTP proxy set successfully")

if __name__ == "__main__":
main()
curl --request POST \
--url https://gbox.ai/api/v1/boxes/{boxId}/proxy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"host": "127.0.0.1",
"port": 8080
}
'
{
  "host": "127.0.0.1",
  "port": 8080,
  "auth": {
    "username": "admin",
    "password": "password"
  },
  "excludes": [
    "127.0.0.1",
    "localhost"
  ],
  "pacUrl": "http://proxy.company.com/proxy.pac"
}

Authorizations

Authorization
string
header
required

Enter your API Key in the format: Bearer . Get it from https://gbox.ai

Path Parameters

boxId
string
required

Box ID

Example:

"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"

Body

application/json

Box Http Proxy

host
string
required

The host address of the proxy server

Example:

"127.0.0.1"

port
number
required

The port number of the proxy server

Example:

8080

auth
Auth · object

Authentication for the proxy

excludes
string[]

List of IP addresses and domains that should bypass the proxy. These addresses will be accessed directly without going through the proxy server. Default is ['127.0.0.1', 'localhost']

Example:
["127.0.0.1", "localhost"]
pacUrl
string

PAC (Proxy Auto-Configuration) URL.

Example:

"http://proxy.company.com/proxy.pac"

Response

200 - application/json

Proxy set

Box Http Proxy

host
string
required

The host address of the proxy server

Example:

"127.0.0.1"

port
number
required

The port number of the proxy server

Example:

8080

auth
Auth · object

Authentication for the proxy

excludes
string[]

List of IP addresses and domains that should bypass the proxy. These addresses will be accessed directly without going through the proxy server. Default is ['127.0.0.1', 'localhost']

Example:
["127.0.0.1", "localhost"]
pacUrl
string

PAC (Proxy Auto-Configuration) URL.

Example:

"http://proxy.company.com/proxy.pac"