/
githubmirror
/
GoFrame
Обзор
Документация
Войти
/
githubmirror
/
GoFrame
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
net/gclient/gclient_websocket.go
30 строк
746 B
John Guo
move package /net/ghttp/internal/client as /net/gclient
03 дек 2021, 18:32
03 дек 2021, 18:32
8de176d
Код
Авторство
О чём код?
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package gclient import ( "net/http" "time" "github.com/gorilla/websocket" ) // WebSocketClient wraps the underlying websocket client connection // and provides convenient functions. type WebSocketClient struct { *websocket.Dialer } // NewWebSocket creates and returns a new WebSocketClient object. func NewWebSocket() *WebSocketClient { return &WebSocketClient{ &websocket.Dialer{ Proxy: http.ProxyFromEnvironment, HandshakeTimeout: 45 * time.Second, }, } }