Username, Password along with the Port. You can find these credentials in the configured list.
Code Examples
Once you have your proxy credentials, use the following code to send your first request:curl --proxy [login]:[password].oculus-proxy.com:[port] http://httpbin.org/ip
package main
import (
"fmt"
"net/http"
"net/url"
"time"
"io/ioutil"
"encoding/json"
)
type IPResponse struct {
Origin string `json:"origin"`
}
func testProxy(proxy *url.URL) {
client := &http.Client{
Transport: &http.Transport{
Proxy: http.ProxyURL(proxy),
},
Timeout: 5 * time.Second,
}
resp, err := client.Get("http://httpbin.org/ip")
if err != nil {
fmt.Printf("Error occurred while testing proxy %s: %s\n", proxy.String(), err)
return
}
defer resp.Body.Close()
if resp.StatusCode == 200 {
body, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Printf("Error reading response from proxy %s: %s\n", proxy.String(), err)
return
}
var ipResp IPResponse
if err := json.Unmarshal(body, &ipResp); err != nil {
fmt.Printf("Error parsing JSON from proxy %s: %s\n", proxy.String(), err)
return
}
fmt.Printf("Proxy %s is working. Your IP: %s\n", proxy.String(), ipResp.Origin)
} else {
fmt.Printf("Proxy %s returned status code %d\n", proxy.String(), resp.StatusCode)
}
}
func main() {
proxyStr := "http://[login]:[password]@proxy.oculus-proxy.com:[port]"
proxyURL, err := url.Parse(proxyStr)
if err != nil {
fmt.Printf("Invalid proxy URL %s: %s\n", proxyStr, err)
} else {
testProxy(proxyURL)
}
}
const axios = require('axios');
async function testProxy(proxy) {
try {
const response = await axios.get("http://httpbin.org/ip", {
proxy,
timeout: 5000
});
if (response.status === 200) {
console.log(`Proxy %O is working. Your IP: ${response.data.origin}`, proxy);
} else {
console.log(`Proxy %O returned status code ${response.status}`, proxy);
}
} catch (error) {
console.log(`Error occurred while testing proxy %O: ${error.message}`, proxy);
}
}
async function main() {
const proxy = {
host: 'proxy.oculus-proxy.com',
port: '[port]',
auth: {username: '[login]', password: '[password]'},
};
await testProxy(proxy);
}
main();
import requests
def test_proxy(proxy):
try:
response = requests.get("http://httpbin.org/ip", proxies={"http": proxy, "https": proxy}, timeout=5)
if response.ok:
print(f"Proxy {proxy} is working. Your IP: {response.json()['origin']}")
else:
print(f"Proxy {proxy} returned status code {response.status_code}")
except Exception as e:
print(f"Error occurred while testing proxy {proxy}: {e}")
def main():
proxy = "http://[login]:[password]@proxy.oculus-proxy.com:[port]"
test_proxy(proxy)
if __name__ == "__main__":
main()
<?php
function testProxy($proxy) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://httpbin.org/ip");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_PROXY, $proxy['host']);
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy['port']);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxy['login'] . ':' . $proxy['password']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($httpCode == 200) {
$data = json_decode($response, true);
echo "Proxy {$proxy['host']}:{$proxy['port']} is working. Your IP: {$data['origin']}\n";
} else {
echo "Proxy {$proxy['host']}:{$proxy['port']} returned status code $httpCode\n";
}
if (curl_errno($ch)) {
echo 'Error occurred while testing proxy ' . "{$proxy['host']}:{$proxy['port']}: " . curl_error($ch) . "\n";
}
curl_close($ch);
}
function main() {
$proxy = [
'host' => 'proxy.oculus-proxy.com',
'port' => '[port]',
'login' => '[login]',
'password' => '[password]',
];
testProxy($proxy);
}
main();
?>
{
"origin": "1.2.3.4"
}