Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions residential/samples/puppeteer.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ const puppeteer = require('puppeteer');
const page = (await browser.pages())[0];

await page.authenticate({
username: '{PROXY_USERNAME},
username: '{PROXY_USERNAME}',
password: '{API_KEY}'
});
await page.goto('https://cloudflare.com/cdn-cgi/trace'); // Insert your target URL here
console.log(await page.content());
browser.close();
})();
```
```
4 changes: 2 additions & 2 deletions residential/samples/python.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: '(Vanilla) Python'
description: 'To connect to the Massive Network from Python, include your encoded credentials in the proxy address (this usage doesn’t risk leaking your API token to a shared history file per the caveat for Curl):'
---

```javascript
```python
#!/usr/bin/env python3
import requests
import urllib
Expand All @@ -17,4 +17,4 @@ proxy = f'https://{username}:{password}@{host}:{port}'
response = requests.get(url, proxies={'http': proxy, 'https': proxy})

print(response.content)
```
```
33 changes: 16 additions & 17 deletions residential/samples/ruby.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@ title: 'Ruby'
description: 'Ruby’s standard HTTP library doesn’t seem to support HTTPS proxy connections, so connect to the [Massive Network’s HTTP port](/authentication#http) with Ruby:'
---

```javascript
#!/usr/bin/env node
const puppeteer = require('puppeteer');
```ruby
#!/usr/bin/env ruby
require 'net/http'
require 'uri'

(async () => {
const browser = await puppeteer.launch({
args: ['--proxy-server=https://network.joinmassive.com:65535']
});
const page = (await browser.pages())[0];
username = '{PROXY_USERNAME}'
password = '{API_KEY}'
url = URI('https://cloudflare.com/cdn-cgi/trace') # Insert your target URL here
host = 'network.joinmassive.com'
port = 65534

await page.authenticate({
username: '{PROXY_USERNAME},
password: '{API_KEY}'
});
await page.goto('https://cloudflare.com/cdn-cgi/trace'); // Insert your target URL here
console.log(await page.content());
browser.close();
})();
```
proxy = Net::HTTP.Proxy(host, port, username, password)
response = proxy.start(url.host, url.port, use_ssl: url.scheme == 'https') do |http|
http.request(Net::HTTP::Get.new(url))
end

puts response.body
```