Skip to content
Discussion options

You must be logged in to vote

other: Use gin(Not necessary) + webtransport

package main

import (
    "net/http"
    "os"
    "os/signal"
    "syscall"
    "time"

    "github.com/gin-gonic/gin"
    "github.com/zishang520/engine.io/v2/engine"
    "github.com/zishang520/engine.io/v2/log"
    "github.com/zishang520/engine.io/v2/types"
    "github.com/zishang520/engine.io/v2/webtransport"
    "github.com/zishang520/socket.io/v2/socket"
)

func main() {
    log.DEBUG = true
    c := socket.DefaultServerOptions()
    c.SetServeClient(true)
    // c.SetConnectionStateRecovery(&socket.ConnectionStateRecovery{})
    // c.SetAllowEIO3(true)
    c.SetPingInterval(300 * time.Millisecond)
    c.SetPingTimeout(200 * time.Millisecond

Replies: 8 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by zishang520
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #80 on February 10, 2025 04:03.