Skip to content
Merged
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
64 changes: 61 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
- ⚑ **Native Performance** β€” 50-100x faster than curl-impersonate (no process spawning)
- πŸ”’ **TLS Fingerprinting** β€” Perfect JA3/JA4 signatures matching real browsers
- 🌐 **HTTP/2 Fingerprinting** β€” Authentic SETTINGS frames, PRIORITY, and header ordering
- 🎭 **Multiple Browser Profiles** β€” Chrome, Firefox, Safari, Edge
- 🎭 **Multiple Browser Profiles** β€” Chrome, Firefox, Safari, Edge, Opera, OkHttp (78+ profiles)
- πŸ”Œ **WebSocket Support**
- πŸ“¦ **Zero Dependencies** β€” Pure Rust with BoringSSL under the hood
- πŸ’Ž **TypeScript Support** β€” Full type definitions included
- πŸ›‘οΈ **Protection Bypass** β€” Cloudflare, Akamai, and other anti-bot systems
Expand Down Expand Up @@ -118,12 +119,41 @@ import { request } from 'node-wreq';
const response = await request({
url: 'https://example.com',
browser: 'chrome_137',
proxy?: 'http://proxy.example.com:8080',
// or with authentication:
// proxy: 'http://proxy.example.com:8080',
// proxy: 'http://username:password@proxy.example.com:8080',
// proxy: 'socks5://proxy.example.com:1080',
});
```

### WebSocket Connection

```typescript
import { websocket } from 'node-wreq';

const ws = await websocket({
url: 'wss://echo.websocket.org',
browser: 'chrome_137',
onMessage: (data) => {
console.log('Received:', data);
},
onClose: () => {
console.log('Connection closed');
},
onError: (error) => {
console.error('Error:', error);
},
});

// Send text message
await ws.send('Hello!');

// Send binary message
await ws.send(Buffer.from([1, 2, 3]));

// Close connection
await ws.close();
```

## πŸ“š API Reference

### `request(options:` [`RequestOptions`](#requestoptions)`): Promise<`[`Response`](#response)`>`
Expand Down Expand Up @@ -162,6 +192,33 @@ interface Response {

### `post(url: string, body?: string, options?): Promise<`[`Response`](#response)`>`

### `websocket(options:` [`WebSocketOptions`](#websocketoptions)`): Promise<WebSocket>`


**Options:**
<a name="websocketoptions"></a>

```typescript
interface WebSocketOptions {
url: string; // Required: WebSocket URL (ws:// or wss://)
browser?: BrowserProfile; // Default: 'chrome_137'
headers?: Record<string, string>;
proxy?: string; // HTTP/HTTPS/SOCKS5 proxy URL
onMessage: (data: string | Buffer) => void; // Required: Message callback
onClose?: () => void; // Optional: Close callback
onError?: (error: string) => void; // Optional: Error callback
}
```

**WebSocket Methods:**

```typescript
class WebSocket {
send(data: string | Buffer): Promise<void>;
close(): Promise<void>;
}
```

### `getProfiles():` [`BrowserProfile[]`](#browser-profiles)

Get list of available browser profiles.
Expand All @@ -170,6 +227,7 @@ Get list of available browser profiles.
import { getProfiles } from 'node-wreq';

const profiles = getProfiles();

console.log(profiles);
// ['chrome_100', 'chrome_101', ..., 'chrome_137', 'edge_101', ..., 'safari_18', ...]
```
Expand Down
Loading