From 55fb18b6e152152551b74b8187d3faf674aa6723 Mon Sep 17 00:00:00 2001 From: Darien Raymond Date: Fri, 27 Jan 2017 13:50:38 +0100 Subject: [PATCH] reduce websocket buffer size --- transport/internet/websocket/dialer.go | 4 ++-- transport/internet/websocket/hub.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/transport/internet/websocket/dialer.go b/transport/internet/websocket/dialer.go index 7c93a779..6b5567a1 100644 --- a/transport/internet/websocket/dialer.go +++ b/transport/internet/websocket/dialer.go @@ -56,8 +56,8 @@ func wsDial(ctx context.Context, dest v2net.Destination) (*wsconn, error) { dialer := websocket.Dialer{ NetDial: commonDial, - ReadBufferSize: 65536, - WriteBufferSize: 65536, + ReadBufferSize: 32 * 1024, + WriteBufferSize: 32 * 1024, } protocol := "ws" diff --git a/transport/internet/websocket/hub.go b/transport/internet/websocket/hub.go index 630f6608..eba47c53 100644 --- a/transport/internet/websocket/hub.go +++ b/transport/internet/websocket/hub.go @@ -134,8 +134,8 @@ func (wsl *WSListener) listenws(address v2net.Address, port v2net.Port) error { func (wsl *WSListener) converttovws(w http.ResponseWriter, r *http.Request) (*wsconn, error) { var upgrader = websocket.Upgrader{ - ReadBufferSize: 65536, - WriteBufferSize: 65536, + ReadBufferSize: 32 * 1024, + WriteBufferSize: 32 * 1024, } conn, err := upgrader.Upgrade(w, r, nil)