Skip to main content

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 to 127.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

ModeDescription
Static ReplacementDirect byte replacement, no length recalculation
Dynamic Calculation (Recommended)Recalculates packet length after replacement
Recommended

Use "Dynamic Calculation" mode in most scenarios to ensure correct packet length after replacement.

Data Pool Selection Strategy

StrategyDescription
Fixed SelectionAlways selects the first item (for debugging)
Sequential SelectionCycles 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:

SettingDescription
First Write OffsetOffset for the first write operation
Process 00-prefix GameIDWhether to replace GameIDs starting with 00
Process 0B-suffix GameIDWhether to replace GameIDs ending with 0B

Game Type Filtering

When enabled, only heartbeat data of the specified game type is used for replacement:

  1. Check "Use Game Type Filter"
  2. Select target game type from the dropdown
  3. 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.

info

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.

Important

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:

FieldDescription
StatusEnabled/Disabled
Rule NameCustom name
Primary FeatureMain byte feature to match (e.g., 01 0A 00 23)
Secondary FeatureAuxiliary matching feature
RemarksNotes

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

SettingDescription
Enable Secondary ProxyEnable chain proxy forwarding
Proxy AddressIP or domain of the downstream SOCKS5 proxy
Proxy PortPort of the downstream proxy
Proxy UsernameAuthentication username for the secondary proxy (if needed)
Proxy PasswordAuthentication password for the secondary proxy (if needed)
Forward Modified PacketsWhether 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 / +10012 for one-click addition of common ports
  • Remove: Delete the selected port
  • Clear Ports: Remove all ports
tip

SNI filtering effectively reduces unnecessary packet analysis, improving proxy performance. Enable it when you know the target game server domain.

Security Tip

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

  1. Client initiates HTTPS connection through the proxy
  2. Proxy intercepts the TLS ClientHello message
  3. Extracts the target domain from the SNI extension field
  4. Compares the domain against configured target domains
  5. 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 ActionDescription
AllowAllow heartbeat replacement for this packet
LogOnlyLog only, no processing
DropDrop the packet, don't forward
SkipReplaceSkip 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:

FieldDescription
StatusEnabled/Disabled
Rule NameCustom name
ActionAction on match (Allow/LogOnly/Drop/SkipReplace)
LogicMulti-condition logic (AND/OR)
ConditionsNumber of matching conditions
Hit CountRuntime hit count for this rule
RemarksNotes

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

SettingDescription
Enable Packet ReplaceToggle
Execution TimingBefore heartbeat / After heartbeat / Replace only (skip heartbeat)
Continue on ErrorSingle 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

ModeDescription
Any PositionMatch anywhere in the packet
Fixed OffsetMatch at a specified offset
Range MatchMatch within a specified byte range
First OnlyMatch only the first occurrence

Bottom Packet List

Real-time display of packets passing through the proxy:

ColumnDescription
IDPacket sequence number
TypePacket type tag
TimeReceive time
GameIDGameID extracted from packet
SizePacket byte size
StatusPacket integrity status
ForwardForward processing result
HeartbeatHeartbeat replacement result
Data PreviewHexadecimal preview of packet data

Click "Clear List" to remove all displayed records.