RuleGo RuleGo
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文
🏠Home
  • Quick Start
  • Rule Chain
  • Standard Components
  • Extension Components
  • Custom Components
  • Visualization
  • RuleGo-Server
  • AOP
  • Trigger
  • Advanced Topics
  • Performance
  • Standard Components
  • Extension Components
  • Custom Components
  • Components Marketplace
  • Overview
  • Quick Start
  • Routing
  • DSL
  • API
  • Options
  • Components
🔥Editor (opens new window)
  • RuleGo Editor (opens new window)
  • RuleGo Server (opens new window)
  • StreamSQL
  • AI Agent Framework
  • TPCLAW Agent Platform (opens new window)
  • Github (opens new window)
  • Gitee (opens new window)
  • Changelog (opens new window)
  • English
  • 简体中文

广告采用随机轮播方式显示 ❤️成为赞助商
  • Quick Start

  • Rule Chain

  • Standard Components

  • Extension Components

  • Custom Components

  • Components marketplace

  • Visualization

  • AOP

  • Trigger

  • Advanced Topic

  • Agent Framework

  • RuleGo-Server

  • FAQ

  • Endpoint Module

    • Endpoint Overview
    • Quick Start
    • Router
    • DSL
    • API
    • Options
    • Endpoints

      • Rest Endpoint
      • Websocket Endpoint
        • Type
        • Startup configuration
        • Session Addressing & Active Push
        • Examples
      • MQTT Endpoint
      • Schedule Endpoint
      • Net Endpoint
      • Kafka Endpoint
      • Nats Endpoint
      • Redis Sub Endpoint
      • Redis Stream Endpoint
      • Rabbitmq Endpoint
      • MYSQL CDC Endpoint
      • OPC_UA Endpoint
      • gRPC Stream Endpoint
      • Beanstalkd Endpoint
      • Wukongim Endpoint
      • Extend Endpoint
      • NSQ Endpoint
      • Pulsar Endpoint
      • net client endpint
      • Websocket Client Endpoint
  • Support

  • StreamSQL

目录

Websocket Endpoint

Websocket Endpoint is used to create and start Websocket receiving service, it can register different routes Router to handle different requests.

# Type

endpoint/ws

# Startup configuration

This component allows the reuse of shared connection clients through the server field. See Component Connection Reuse for reference.

Field Type Required Description Default
server string Yes ws service address, e.g. ":8080" -
certFile string No Cert file path 0
certKeyFile string No CertKey file path -
sessionKey string No Session addressing key extraction rule (rulego ${} expression). E.g. ${msg.deviceId} extracts deviceId from first frame; empty uses RemoteAddr -
sessionTTL int No Session idle TTL (seconds); the connection is closed after idle timeout; <=0 uses default 1800 1800

# Session Addressing & Active Push

endpoint/ws has a built-in session registry maintaining a session for each connected WebSocket client. Combined with a ws node (server=ref://<this endpoint instance ID>), you can reuse a client's established WS connection to actively push messages to specific clients by sessionKey (e.g. deviceId), exact match.

The sessionKey config is the same as endpoint/net: a rulego ${} expression extracts the session key from the first frame reported by the client (e.g. ${msg.deviceId}), fixed after the first success; empty uses RemoteAddr. See endpoint/net - Session Addressing & Active Push.

The push side uses a ws node in ref:// addressing mode. See ws component.

# Examples

The following are example codes using endpoint:

  • RestEndpoint (opens new window)
  • WebsocketEndpoint (opens new window)
  • MqttEndpoint (opens new window)
  • ScheduleEndpoint (opens new window)
  • NetEndpoint (opens new window)
  • KafkaEndpoint (opens new window) (Extended component library)
Edit this page on GitHub (opens new window)
Last Updated: 2026/07/29, 07:07:39
Rest Endpoint
MQTT Endpoint

← Rest Endpoint MQTT Endpoint→

Theme by Vdoing | Copyright © 2023-2026 RuleGo Team | Apache 2.0 License

  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式