diff --git a/recws.go b/recws.go index 94aec5c..e9b4463 100644 --- a/recws.go +++ b/recws.go @@ -54,8 +54,7 @@ type RecConn struct { httpResp *http.Response dialErr error dialer *websocket.Dialer - // if set to true, close stops dial reconnection - close chan (bool) + close chan (bool) *websocket.Conn } @@ -292,7 +291,9 @@ func (rc *RecConn) Dial(urlStr string, reqHeader http.Header) { log.Fatalf("Dial: %v", err) } + // Close channel rc.close = make(chan bool, 1) + // Config rc.setURL(urlStr) rc.setReqHeader(reqHeader)