Skip to content

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JT808 Go Pressure Client

中文说明: README.zh-CN.md

Project notice: this project was generated with AI assistance.

This directory contains a lightweight JT808 TCP pressure test client.

Features

  • Simulate multiple JT808 clients sending 0200 position packets
  • Send 0102 terminal authentication once on each connect / reconnect
  • Periodically send 0002 heartbeat packets
  • Randomized first-send delay and connection step startup
  • Auto reconnect on disconnect
  • Optional max connection age to force reconnect

Build

go build -o jt808-client .

Run

On startup, the program automatically attempts to load ./config.json from the current working directory. If -config is provided, the program loads that file instead. CLI flags override values loaded from the config file. If no config file is found and no CLI arguments are provided, the program prints help.

./jt808-client -host 192.168.1.222 -port 8808 -clients 100

Config File

The repository includes a sample config.json. By default the program auto-attempts to load ./config.json; you can use -config to point to another file.

./jt808-client
./jt808-client -config ./config.json
./jt808-client -config ./config.json -clients 200

JSON keys use snake_case names corresponding to the CLI options:

  • clients
  • host
  • port
  • groupid
  • interval
  • heartbeat_interval
  • first_send_delay_max
  • connect_timeout
  • write_timeout
  • max_connection_age
  • ip_prefix
  • connect_step_min / connect_step_max
  • connect_pause_min_ms / connect_pause_max_ms
  • test

Common Options

  • -config: path to JSON config file, default config.json
  • -clients: number of simulated clients
  • -host: target server host
  • -port: target server port
  • -g / -groupid: phone group id (01-99)
  • -interval: 0200 send interval (seconds)
  • -heartbeat-interval: 0002 send interval (seconds)
  • -first-send-delay-max: max random delay before first 0200 (seconds)
  • -connect-timeout: TCP connect timeout (seconds)
  • -write-timeout: TCP write timeout (seconds)
  • -max-connection-age: reconnect after this connection age (seconds)
  • -ip-prefix: IPv4 prefix or full address to select local interface (empty = first available)
  • -connect-step-min / -connect-step-max: clients per random startup step
  • -connect-pause-min-ms / -connect-pause-max-ms: pause between startup steps
  • -test: print one sample 0200 packet as hex and exit

Quick Test

./jt808-client -test

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages