Proxy Script
Although you can write a script to get the proxy and test it directly while creating a profile,
Bịp Studio also supports you to test this script, click on the NETWORK
tab, and set the proxy type as Custom
. Then open the PROXY SCRIPT
tab in the code editor area and start writing your script.
Proxy Script supports the following functions.
SetResult#
This function is required, no matter how you handle it, you need to call this function in the end to return the result to Bịp Profile.
result
is an object with the following properties
Properties | Description |
---|---|
Type |
Proxy type, valid values: http , socks4 , socks5 , ssh |
Server |
Proxy server, including port if available |
User |
Proxy user if available |
Password |
Password if available |
Error |
In case of error, you can put error message in Error attribute, Bip will display error in Status column. |
Log#
Display a message in the Status
column of the profile which running this script.
Parameters
Parameters | Description |
---|---|
text |
Message you want to display as text |
See the examples below.
RandomInt#
Generates a random integer in the specified range.
Parameters
Parameters | Description |
---|---|
min |
Range start |
max |
Range end |
RandomArray#
Randomly retrieve an element from an array.
Parameters
Parameters | Description |
---|---|
array |
Input array |
Example
Delay#
Delay a specified amount of time.
Parameters
Parameters | Description |
---|---|
ms |
Delay time in milliseconds |
Example
HttpRequest#
Make an HTTP request, useful when you want to integrate a proxy through an API from a 3rd provider.
Parameters
Parameters | Description |
---|---|
url |
Link to send request to |
data |
Data sent in POST method |
timeoutMS |
Time limit in milliseconds, if the server does not return the result after the time limit, it will return a timed out error |
headers |
Custom HTTP header |
Return result
An object with properties illustrated as follows
Example
ReadFile#
Read data from a file as text.
Parameters
Parameters | Description |
---|---|
file |
Path to the file to read |
Returns: Text data or null if there is an error
Example
RootPath#
This is a constant that indicates the current path that Bịp Profile is running on.
BipGlobal#
A global object that exists since Bịp Profile is started until you exited, accessible from any profile globaly.
Example
Profile#
An object that contains information about the profile that is running the script, including:
Properties | Description |
---|---|
Id |
Id of the profile (can be seen in the ID column) |
Title |
Name of the profile |
Index |
Order of the profile in the list (can be changed if you sort the profile list) |
Example
Once you have written your script, you can set up your profile in the proxy options when creating or updating a profile.