@@ -5,16 +5,13 @@ import (
5
5
"errors"
6
6
"net"
7
7
"net/http"
8
- "strings"
9
8
"time"
10
9
11
10
"github.com/getlantern/idletiming"
12
11
"github.com/getlantern/proxy/v3/filters"
13
12
14
13
"github.com/getlantern/flashlight/v7/chained"
15
- "github.com/getlantern/flashlight/v7/common"
16
14
"github.com/getlantern/flashlight/v7/ops"
17
- "github.com/getlantern/flashlight/v7/pro"
18
15
)
19
16
20
17
func (client * Client ) handle (conn net.Conn ) error {
@@ -47,11 +44,6 @@ func (client *Client) filter(cs *filters.ConnectionState, req *http.Request, nex
47
44
req .URL .Scheme = "http"
48
45
req .URL .Host = req .Host
49
46
50
- if common .Platform == "android" && req .URL != nil && req .URL .Host == "localhost" &&
51
- strings .HasPrefix (req .URL .Path , "/pro/" ) {
52
- return client .interceptProRequest (cs , req )
53
- }
54
-
55
47
op , ok := client .opsMap .get (cs .Downstream ())
56
48
if ok {
57
49
op .UserAgent (req .Header .Get ("User-Agent" )).OriginFromRequest (req )
@@ -118,25 +110,6 @@ func (client *Client) isHTTPProxyPort(r *http.Request) bool {
118
110
return false
119
111
}
120
112
121
- // interceptProRequest specifically looks for and properly handles pro server
122
- // requests (similar to desktop's APIHandler)
123
- func (client * Client ) interceptProRequest (cs * filters.ConnectionState , r * http.Request ) (* http.Response , * filters.ConnectionState , error ) {
124
- log .Debugf ("Intercepting request to pro server: %v" , r .URL .Path )
125
- // Strip /pro from path.
126
- r .URL .Path = r .URL .Path [4 :]
127
- pro .PrepareProRequest (r , client .user )
128
- r .Header .Del ("Origin" )
129
- resp , err := common .GetHTTPClient ().Do (r )
130
- if err != nil {
131
- log .Errorf ("Error intercepting request to pro server: %v" , err )
132
- resp = & http.Response {
133
- StatusCode : http .StatusInternalServerError ,
134
- Close : true ,
135
- }
136
- }
137
- return filters .ShortCircuit (cs , r , resp )
138
- }
139
-
140
113
func (client * Client ) redirectHTTPS (cs * filters.ConnectionState , req * http.Request , httpsURL string , op * ops.Op ) (* http.Response , * filters.ConnectionState , error ) {
141
114
log .Debugf ("httpseverywhere redirecting to %v" , httpsURL )
142
115
if op != nil {
0 commit comments