Heartbeat Simulation
Heartbeat Simulation is the core feature page of HeartbeatSocks, responsible for intercepting and replacing heartbeat characteristics in user data packets. The page contains 6 configuration tabs: Basic Config, Feature Config, Secondary Proxy, SNI Filter, Packet Filter, and Packet Replace.
┌─────────────────────────────────────────────────────────────────────────┐
│ Heartbeat Simulation Page │
├───────────┬───────────┬───────────┬───────────┬──────────┬─────────────┤
│ Basic │ Feature │ Secondary │ SNI │ Packet │ Packet │
│ Config │ Config │ Proxy │ Filter │ Filter │ Replace │
├───────────┴───────────┴───────────┴───────────┴──────────┴─────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Current Tab Content Area │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │
├─────────────────────────────────────────────────────────────────────────┤
│ Bottom Real-time Packet List │
│ ID │ Type │ Time │ GameID │ Size │ Status │ Forward │ HB │ Preview │
└─────────────────────────────────────────────────────────────────────────┘
Start and Stop
The top control bar provides:
- Listen Port: Local port for the heartbeat simulation proxy, default
1088. Clients should set their SOCKS5 proxy to127.0.0.1:1088 - Start Service / Stop Service: Control the proxy service
Before starting, ensure:
- The data pool has sufficient heartbeat data (50+ entries recommended)
- Heartbeat features are correctly configured
- The listen port is not in use
Tab 1: Basic Config
Length Calculation Mode
| Mode | Description |
|---|---|
| Static Replacement | Direct byte replacement, no length recalculation |
| Dynamic Calculation (Recommended) | Recalculates packet length after replacement |
Use "Dynamic Calculation" mode in most scenarios to ensure correct packet length after replacement.
Data Pool Selection Strategy
| Strategy | Description |
|---|---|
| Fixed Selection | Always selects the first item (for debugging) |
| Sequential Selection | Cycles through items in order |
| Random Selection (Recommended) | Random selection, most natural behavior |
Feature 62 Support
When enabled, adds support for processing the 01 0A 00 62 feature (complementary to the 09 feature).
Advanced Offset Configuration
Expandable section for:
| Setting | Description |
|---|---|
| First Write Offset | Offset for the first write operation |
| Process 00-prefix GameID | Whether to replace GameIDs starting with 00 |
| Process 0B-suffix GameID | Whether to replace GameIDs ending with 0B |
Game Type Filtering
When enabled, only heartbeat data of the specified game type is used for replacement:
- Check "Use Game Type Filter"
- Select target game type from the dropdown
- Game type list is managed on the "Data Collection" page
SOCKS5 Authentication
When enabled, clients must provide username and password to connect. Authentication is managed on the "Account Management" page.
Authentication is a global setting affecting both the collection proxy and heartbeat simulation proxy.
Tab 2: Feature Config
Heartbeat features are byte pattern rules used to identify heartbeat packets, evaluated in list order from top to bottom.
Feature configuration directly affects replacement results. Incorrect configuration may cause game disconnection. Choose features appropriate for the target game.
Feature Rule List
Each rule contains:
| Field | Description |
|---|---|
| Status | Enabled/Disabled |
| Rule Name | Custom name |
| Primary Feature | Main byte feature to match (e.g., 01 0A 00 23) |
| Secondary Feature | Auxiliary matching feature |
| Remarks | Notes |
Management Operations
- Add Rule: Create a new heartbeat feature rule
- Edit: Modify the selected rule's configuration
- Delete: Remove the selected rule
- Enable/Disable: Toggle the rule's active state
- Move Up/Down: Adjust rule matching priority (earlier rules match first)
- Help: View detailed help for heartbeat feature configuration
Tab 3: Secondary Proxy
Supports forwarding modified packets to another SOCKS5 proxy for chained proxying.
Settings
| Setting | Description |
|---|---|
| Enable Secondary Proxy | Enable chain proxy forwarding |
| Proxy Address | IP or domain of the downstream SOCKS5 proxy |
| Proxy Port | Port of the downstream proxy |
| Proxy Username | Authentication username for the secondary proxy (if needed) |
| Proxy Password | Authentication password for the secondary proxy (if needed) |
| Forward Modified Packets | Whether to send replaced data to the secondary proxy |
Tab 4: SNI Filter
SNI (Server Name Indication) filtering analyzes TLS handshake domain information to precisely control which connections undergo heartbeat processing.
Enable SNI Filter
Check "Force Enable SNI Filter". When enabled, only connections matching the target domain will undergo heartbeat replacement; others pass through directly.
Preset Domain List
Left panel manages frequently used domains:
- Add Domain: Enter a domain and click "Add"
- Delete Selected: Remove the selected domain
- Clear All: Remove all preset domains
SNI Listen Ports
Right panel manages ports to sniff for SNI information:
- Manual Add: Enter a port number and click "Add"
- Quick Buttons:
+443/+8443/+10012for one-click addition of common ports - Remove: Delete the selected port
- Clear Ports: Remove all ports
SNI filtering effectively reduces unnecessary packet analysis, improving proxy performance. Enable it when you know the target game server domain.
Enabling SNI filtering effectively prevents your replacement rules from being stolen. Without it, any connection through the proxy triggers heartbeat replacement logic, allowing third parties to capture and analyze traffic to reverse-engineer your rule configuration. With SNI filtering enabled, only connections matching the target domain undergo replacement — all other traffic passes through untouched, preventing your replacement behavior from being exposed. It is strongly recommended to always enable SNI filtering in production environments.
How It Works
- Client initiates HTTPS connection through the proxy
- Proxy intercepts the TLS ClientHello message
- Extracts the target domain from the SNI extension field
- Compares the domain against configured target domains
- Matching connections are marked for heartbeat processing; non-matching connections pass through
Tab 5: Packet Filter
Packet Filter (rule chain mode) provides a flexible packet filtering mechanism that determines which packets should be processed before heartbeat replacement.
Enable and Default Action
- Enable Rule Chain: Turn on packet filtering
- Default Action: Action to take when no rules match
| Default Action | Description |
|---|---|
| Allow | Allow heartbeat replacement for this packet |
| LogOnly | Log only, no processing |
| Drop | Drop the packet, don't forward |
| SkipReplace | Skip replacement, forward packet as-is |
Preset Rule Chains
One-click preset rule chain configurations:
- Delta Force (ACE Block + Game Allow): Preset rules for Delta Force
- General ACE Filter: General ACE anti-cheat filtering rules
Rule List
Each rule contains:
| Field | Description |
|---|---|
| Status | Enabled/Disabled |
| Rule Name | Custom name |
| Action | Action on match (Allow/LogOnly/Drop/SkipReplace) |
| Logic | Multi-condition logic (AND/OR) |
| Conditions | Number of matching conditions |
| Hit Count | Runtime hit count for this rule |
| Remarks | Notes |
Management Operations
- Add Rule: Create a new filter rule
- Edit: Modify the selected rule's conditions and action
- Delete: Remove the selected rule
- Enable/Disable: Toggle the rule's active state
- Move Up/Down: Adjust rule position in the chain (earlier rules match first)
- Reset Statistics: Reset all rule hit counters to zero
Rule Evaluation Logic
Rules are evaluated in list order from top to bottom. The first matching rule determines the final action. If no rules match, the default action is applied.
Example Scenarios
Only replace traffic on specific ports:
Rule 1: Port = 443 → Allow
Default Action: SkipReplace
Exclude specific domains:
Rule 1: Domain = cdn.example.com → SkipReplace
Rule 2: Domain = static.example.com → SkipReplace
Default Action: Allow
Tab 6: Packet Replace
Custom byte sequence replacement rules beyond heartbeat replacement.
Enable and Configure
| Setting | Description |
|---|---|
| Enable Packet Replace | Toggle |
| Execution Timing | Before heartbeat / After heartbeat / Replace only (skip heartbeat) |
| Continue on Error | Single rule failure doesn't affect subsequent rules |
Replacement Rule List
Each rule defines search and replace byte sequences:
- Add Rule: Create a new replacement rule
- Delete: Remove the selected rule
- Move Up/Down: Adjust execution order
Matching Modes
| Mode | Description |
|---|---|
| Any Position | Match anywhere in the packet |
| Fixed Offset | Match at a specified offset |
| Range Match | Match within a specified byte range |
| First Only | Match only the first occurrence |
Bottom Packet List
Real-time display of packets passing through the proxy:
| Column | Description |
|---|---|
| ID | Packet sequence number |
| Type | Packet type tag |
| Time | Receive time |
| GameID | GameID extracted from packet |
| Size | Packet byte size |
| Status | Packet integrity status |
| Forward | Forward processing result |
| Heartbeat | Heartbeat replacement result |
| Data Preview | Hexadecimal preview of packet data |
Click "Clear List" to remove all displayed records.