sockjs-go
https://github.com/igm/sockjs-go
官方示例:
import (
"log"
"net/http"
"github.com/igm/sockjs-go/v3/sockjs"
)
func main() {
handler := sockjs.NewHandler("/echo", sockjs.DefaultOptions, echoHandler)
log.Fatal(http.ListenAndServe(":8081", handler))
}
在gin框架中使用sockjs-go
https://github.com/igm/sockjs-go/issues/85
问题描述
GET http://localhost:8000/echo/info?t=1486141708375 404 (Not Found)
解决办法
https://github.com/gin-gonic/gin/issues/799
r.Any("/echo/*info", gin.WrapH(k8spod.CreateAttachHandler("/echo")))
注意:
最后的/echo不能增加/结尾