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"
}Box
Set proxy
Configures the HTTP proxy settings for a specific box. Use this endpoint when you need the box’s outbound network traffic to pass through a proxy server.
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
Enter your API Key in the format: Bearer . Get it from https://gbox.ai
Body
application/json
Box Http Proxy
Response
200 - application/json
Proxy set
Box Http Proxy
Was this page helpful?