Improve: clean code

This commit is contained in:
Dreamacro
2018-08-12 16:18:58 +08:00
parent fc4f119049
commit ebe1cee6dc
7 changed files with 97 additions and 83 deletions

View File

@ -7,7 +7,7 @@ import (
C "github.com/Dreamacro/clash/constant"
)
func (t *Tunnel) handleHTTP(request *adapters.HttpAdapter, proxy C.ProxyAdapter) {
func (t *Tunnel) handleHTTP(request *adapters.HTTPAdapter, proxy C.ProxyAdapter) {
conn := newTrafficTrack(proxy.Conn(), t.traffic)
// Before we unwrap src and/or dst, copy any buffered data.

View File

@ -104,7 +104,7 @@ func (t *Tunnel) handleConn(localConn C.ServerAdapter) {
defer remoConn.Close()
switch adapter := localConn.(type) {
case *LocalAdapter.HttpAdapter:
case *LocalAdapter.HTTPAdapter:
t.handleHTTP(adapter, remoConn)
case *LocalAdapter.SocksAdapter:
t.handleSOCKS(adapter, remoConn)