GoWindGoWind
Home
Framework
GoWind Toolkit
  • Open Source

    • GoWind Admin (Admin Platform)
    • GoWind CMS (Content Management)
    • GoWind UBA (Behavior Analytics)
    • GoWind Shop (E-commerce)
    • GoWind Kanban (Kanban Boards)
    • GoWind Ledger (Personal Finance)
    • GoWind ShortPlay (Short Drama)
    • GoWind Ops (Operations Platform)
    • RushWind (Rust Ecosystem)
  • Open Core (Community + Enterprise)

    • GoWind OA (Office Collaboration)
    • GoWind ERP (Procure-to-Pay)
    • GoWind WMS (Warehousing)
  • Commercial

    • GoWind IM (Instant Messaging)
    • GoWind IoT (IoT Platform)
    • GoWind Edu (AI Education)
    • GoWind MES (Manufacturing Execution)
    • GoWind CDC (Data Pipeline)
    • GoWind SDP (Zero-Trust Gateway)
    • GoWind Quant (Quant Research)
    • GoWind Trade Radar (Export Sourcing)
    • GoWind Game Radar (Game Greenlight)
  • 简体中文
  • English
GitHub
Home
Framework
GoWind Toolkit
  • Open Source

    • GoWind Admin (Admin Platform)
    • GoWind CMS (Content Management)
    • GoWind UBA (Behavior Analytics)
    • GoWind Shop (E-commerce)
    • GoWind Kanban (Kanban Boards)
    • GoWind Ledger (Personal Finance)
    • GoWind ShortPlay (Short Drama)
    • GoWind Ops (Operations Platform)
    • RushWind (Rust Ecosystem)
  • Open Core (Community + Enterprise)

    • GoWind OA (Office Collaboration)
    • GoWind ERP (Procure-to-Pay)
    • GoWind WMS (Warehousing)
  • Commercial

    • GoWind IM (Instant Messaging)
    • GoWind IoT (IoT Platform)
    • GoWind Edu (AI Education)
    • GoWind MES (Manufacturing Execution)
    • GoWind CDC (Data Pipeline)
    • GoWind SDP (Zero-Trust Gateway)
    • GoWind Quant (Quant Research)
    • GoWind Trade Radar (Export Sourcing)
    • GoWind Game Radar (Game Greenlight)
  • 简体中文
  • English
GitHub
  • Introduction

    • GoWind Framework
    • Framework Architecture
  • go-wind Core

    • go-wind Core Framework
    • App Lifecycle Management
    • Context Propagation
    • Transport Abstraction
    • Log Facade Interface
  • go-wind-plugins

    • go-wind-plugins Plugin Overview
    • Plugin Configuration System
    • Plugin Registration Mechanism (SPI)
    • Logging Adapter Plugins
    • Transport Protocol Plugins
    • Message Middleware Plugins
    • Encoding Plugins
    • Security and Authentication Plugins
    • Distributed Tracing Plugins
    • Cache Plugins
    • Object Storage Plugins (OSS)
    • Rate Limiting Plugins
    • Metrics Plugins
    • AI Plugins
    • Workflow Plugins
    • Database and Cache Plugins
    • Bootstrap Integration and Gateway Plugins
    • Compression and Serialization Plugins
    • Template Rendering and Validation Plugins
  • go-wind-bootstrap

    • go-wind-bootstrap: The Declarative Bootstrap
    • The Bootstrap Configuration System
    • The Bootstrap SPI Mechanism
    • Declarative Middleware Orchestration
    • Bootstrap Command-Line Integration
    • Bootstrap Practical Examples
  • go-wind-flow Workflow Engine

    • GoWind Flow Process Engine
  • Tutorials

    • Quick Start Tutorial
    • Custom Plugin Development Tutorial
    • Multi-Protocol Listening Tutorial
    • Framework Migration Guide

Transport Protocol Plugins

go-wind-plugins provides a variety of transport protocol adapters implementing the transport.Server interface. It supports mainstream protocols such as HTTP, gRPC, WebSocket, and SSE, and covers 31 transport plugins in total, including scheduled jobs, async task queues, message-middleware subscriptions, and MCP.

1. Protocol Overview

The transport/ tree contains 31 plugin directories, grouped into four categories by form:

Protocols & Communication

PluginImport PathEngine/NotesTypical Use
HTTPplugins/transport/httpnet/http, with three additional drivers: chi / gin / fiberREST API
HTTP/3plugins/transport/http3quic-go/http3QUIC low-latency web
gRPCplugins/transport/grpcgoogle.golang.org/grpc (server/client/middleware)Internal service calls
WebSocketplugins/transport/websocketgorilla/websocketReal-time communication
Socket.IOplugins/transport/socketiogoogollee/go-socket.ioReal-time communication (Socket.IO protocol)
SignalRplugins/transport/signalrSignalR protocolReal-time communication in the .NET ecosystem
SSEplugins/transport/sseServer-Sent EventsServer-side event push
TCPplugins/transport/tcpnet.ListenerCustom-protocol persistent connections
KCPplugins/transport/kcpxtaci/kcp-goLow-latency gaming
WebRTCplugins/transport/webrtcpion/webrtc v4 (SFU)Real-time audio/video transport
WebTransportplugins/transport/webtransportwebtransport-goBidirectional streams over HTTP/3

RPC & Query

PluginImport PathEngine/Notes
GraphQLplugins/transport/graphqlgraphql-go
Thriftplugins/transport/thriftApache Thrift
tRPCplugins/transport/trpctRPC protocol

Scheduled & Async Tasks

PluginImport PathEngine/Notes
Cronplugins/transport/cronrobfig/cron scheduled jobs
HPTimerplugins/transport/hptimerHigh-precision timer
Asynqplugins/transport/asynqhibiken/asynq async task queue
Machineryplugins/transport/machinerymachinery (Celery-like) distributed task queue

Message-Middleware Subscription Transports

PluginImport PathMiddleware
Kafkaplugins/transport/kafkaApache Kafka
RabbitMQplugins/transport/rabbitmqRabbitMQ
NATSplugins/transport/natsNATS
MQTTplugins/transport/mqttMQTT
Pulsarplugins/transport/pulsarApache Pulsar
RocketMQplugins/transport/rocketmqApache RocketMQ
NSQplugins/transport/nsqNSQ
SQSplugins/transport/sqsAWS SQS
Redisplugins/transport/redisRedis Pub/Sub
ActiveMQplugins/transport/activemqApache ActiveMQ
Azure Service Busplugins/transport/azuresbAzure Service Bus
Google Pub/Subplugins/transport/gcpubsubGoogle Cloud Pub/Sub

AI Protocols

PluginImport PathEngine/Notes
MCPplugins/transport/mcpModel Context Protocol (two server forms: StreamableHTTP / SSE)

2. HTTP Server

import httpPlugin "github.com/tx7do/go-wind-plugins/transport/http"

server := httpPlugin.NewServer(
    httpPlugin.WithAddr(":8080"),
    httpPlugin.WithHandler(router),
    httpPlugin.WithReadTimeout(10*time.Second),
    httpPlugin.WithWriteTimeout(10*time.Second),
    httpPlugin.WithTLS("cert.pem", "key.pem"),
    httpPlugin.WithCORS(true, []string{"*"}),
)

YAML Configuration

server:
  http:
    addr: ":8080"
    read_timeout: 10s
    write_timeout: 10s
    idle_timeout: 60s
    max_header_bytes: 1048576
    cors:
      enabled: true
      origins: ["https://app.example.com"]
      methods: ["GET", "POST", "PUT", "DELETE"]
      credentials: true
    tls:
      enabled: true
      cert_file: certs/cert.pem
      key_file: certs/key.pem

3. gRPC Server

import grpcPlugin "github.com/tx7do/go-wind-plugins/transport/grpc"

server := grpcPlugin.NewServer(
    grpcPlugin.WithAddr(":9090"),
    grpcPlugin.WithServiceDesc(&pb.File_ServiceDesc),
    grpcPlugin.WithInterceptor(unaryInterceptor, streamInterceptor),
    grpcPlugin.WithTLS("cert.pem", "key.pem"),
    grpcPlugin.WithReflection(true),     // gRPC reflection
    grpcPlugin.WithHealthCheck(true),    // health check service
)

YAML Configuration

server:
  grpc:
    addr: ":9090"
    max_recv_msg_size: 4194304
    max_send_msg_size: 4194304
    reflection: true
    health_check: true
    tls:
      enabled: false

Registering gRPC Services

server := grpcPlugin.NewServer(
    grpcPlugin.WithAddr(":9090"),
    grpcPlugin.WithService(
        func(s *grpc.Server) {
            pb.RegisterUserServiceServer(s, &userService{})
        },
    ),
)

4. WebSocket Server

import wsPlugin "github.com/tx7do/go-wind-plugins/transport/websocket"

server := wsPlugin.NewServer(
    wsPlugin.WithAddr(":8081"),
    wsPlugin.WithPath("/ws"),
    wsPlugin.WithUpgrader(upgrader),
    wsPlugin.WithHandler(wsHandler),
    wsPlugin.WithReadBufferSize(4096),
    wsPlugin.WithWriteBufferSize(4096),
    wsPlugin.WithCheckOrigin(true),
)

WebSocket Handler

func wsHandler(conn *wsPlugin.Conn) {
    defer conn.Close()

    for {
        msgType, msg, err := conn.ReadMessage()
        if err != nil {
            break
        }
        // Broadcast the message
        conn.WriteMessage(msgType, msg)
    }
}

5. SSE Server

import ssePlugin "github.com/tx7do/go-wind-plugins/transport/sse"

server := ssePlugin.NewServer(
    ssePlugin.WithAddr(":8082"),
    ssePlugin.WithPath("/events"),
    ssePlugin.WithBufferSize(100),
)

Pushing Events

// Push to a specific client
server.Push(clientID, &ssePlugin.Event{
    Event: "notification",
    Data:  `{"message":"hello"}`,
})

// Broadcast
server.Broadcast(&ssePlugin.Event{
    Event: "update",
    Data:  `{"version":"v2.0"}`,
})

6. TCP Server

import tcpPlugin "github.com/tx7do/go-wind-plugins/transport/tcp"

server := tcpPlugin.NewServer(
    tcpPlugin.WithAddr(":9000"),
    tcpPlugin.WithHandler(tcpHandler),
    tcpPlugin.WithReadTimeout(30*time.Second),
    tcpPlugin.WithKeepAlive(true),
)

7. KCP Server

import kcpPlugin "github.com/tx7do/go-wind-plugins/transport/kcp"

server := kcpPlugin.NewServer(
    kcpPlugin.WithAddr(":9001"),
    kcpPlugin.WithHandler(kcpHandler),
    kcpPlugin.WithMTU(1400),
    kcpPlugin.WithNoDelay(1, 20, 2, 1),
)

8. GraphQL Server

import gqlPlugin "github.com/tx7do/go-wind-plugins/transport/graphql"

server := gqlPlugin.NewServer(
    gqlPlugin.WithAddr(":8083"),
    gqlPlugin.WithSchema(schema),
    gqlPlugin.WithPlayground(true),
    gqlPlugin.WithIntrospection(true),
)

9. Listening on Multiple Protocols at Once

app := wind.New(
    wind.WithName("multi-protocol"),
    wind.WithServer(httpServer),    // HTTP :8080
    wind.WithServer(grpcServer),    // gRPC :9090
    wind.WithServer(wsServer),      // WebSocket :8081
    wind.WithServer(sseServer),     // SSE :8082
)
app.Run(ctx)
server:
  http:
    addr: ":8080"
  grpc:
    addr: ":9090"
  websocket:
    addr: ":8081"
    path: /ws
  sse:
    addr: ":8082"
    path: /events

10. Endpoint Exposure

Every Server exposes its access addresses via the Endpoint() method, which can be used for service registration:

for _, srv := range app.Servers() {
    for _, ep := range srv.Endpoint() {
        fmt.Printf("%s: %s\n", srv.Type(), ep)
    }
}
// Output:
// http: http://0.0.0.0:8080
// grpc: grpc://0.0.0.0:9090
// websocket: ws://0.0.0.0:8081/ws

Recent Updates

  • MCP (transport/mcp): added WithMCPHTTPServerOptions / WithMCPSSEServerOptions to pass through StreamableHTTP / SSE server options (e.g. WithHTTPContextFunc); the server form supports both ServerTypeHTTP and ServerTypeSSE.

Related Documents

  • Transport Abstraction
  • Plugin Configuration System
  • Declarative Middleware Orchestration
  • Multi-Transport Tutorial
Edit this page
Last Updated:: 11/3/26, 2:14 PM
Contributors: Bobo
Prev
Logging Adapter Plugins
Next
Message Middleware Plugins