代码拉取完成,页面将自动刷新
package http
import (
"context"
"net/http"
"github.com/gorilla/websocket"
)
type (
// Upgrader is an HTTP connection that is able to upgrade to websocket.
Upgrader interface {
// Upgrade upgrades the HTTP connection to the websocket protocol.
Upgrade(w http.ResponseWriter, r *http.Request, responseHeader http.Header) (*websocket.Conn, error)
}
// Dialer creates a websocket connection to a given URL.
Dialer interface {
// DialContext creates a client connection to the websocket server.
DialContext(ctx context.Context, url string, h http.Header) (*websocket.Conn, *http.Response, error)
}
// ConnConfigureFunc is used to configure a websocket connection with
// custom handlers. The cancel function cancels the request context when
// invoked in the configure function.
ConnConfigureFunc func(conn *websocket.Conn, cancel context.CancelFunc) *websocket.Conn
)
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。