Commit f86f75d
Add proxy support (#1120)
* - Read proxy env variables and config settings
- Define a function to test that a given path is an active UDS
* Expand paths to the OS user's home directory if they start with "~/" or "%USERPROFILE%\".
* Switch from using "os/user" and `user.Current()` for finding the OS user's home dir, to using "os" and `os.UserHomeDir()`. It requires Go 1.12+.
* Use the UNIX Domain Socket when making connections
* Add SRC_PROXY_SOCKET to the usage output, and remove config settings for a proxy URL.
* Document expandHomeDir function
* Add support for HTTP(S) and SOCKS5 proxies
* Mollify tests
* Add tests
* Refactor: move the proxy handling to a separate file.
* Add tests for a UNIX Domain Socket.
* Fix analysis of url schemes
* Ad tests for socks proxies in the config
* SOCKS proxies work OOTB, so remove the manual dialing for them.
* Use `tls.HandshakeContext`
* - add a proxy test script
- remove "endpoint" from all of the proxy names. The environment variable is now "SRC_PROXY"
- clean up the http(s) proxy dialing code. Experiemented with using http.Request instead of spelling out the CONNECT request manually, but it had enough quircks that I went back to spelling it out manually.
- Add more desriptive messages to the socket config test.
* fix socket test by shortening the length of the file path - UNIX socket paths need to be less than 108-ish characters.
* Fix parameter capitalization
* Add comment about th UDS path length to main_test.go
* Fix formatting in usage message
* Whoops; meant to use `w` instead of `v`! Thanks for catching that.
Co-authored-by: Camden Cheek <camden@ccheek.com>
* Whoops; meant to use `w` instead of `v`! Thanks for catching that.
Co-authored-by: Camden Cheek <camden@ccheek.com>
* Update comment about InsecureSkipVerify
* Make CHANGELOG entry
---------
Co-authored-by: Camden Cheek <camden@ccheek.com>1 parent bca0a8b commit f86f75d
File tree
10 files changed
+651
-30
lines changed- cmd/src
- dev
- internal/api
10 files changed
+651
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
8 | 10 | | |
9 | | - | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
28 | 43 | | |
29 | 44 | | |
30 | 45 | | |
| |||
83 | 98 | | |
84 | 99 | | |
85 | 100 | | |
86 | | - | |
87 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
88 | 105 | | |
89 | 106 | | |
90 | 107 | | |
| |||
95 | 112 | | |
96 | 113 | | |
97 | 114 | | |
| 115 | + | |
| 116 | + | |
98 | 117 | | |
99 | 118 | | |
100 | 119 | | |
101 | | - | |
102 | | - | |
103 | 120 | | |
104 | 121 | | |
105 | | - | |
| 122 | + | |
106 | 123 | | |
107 | 124 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
| 125 | + | |
| 126 | + | |
117 | 127 | | |
118 | 128 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
123 | 132 | | |
| 133 | + | |
124 | 134 | | |
125 | 135 | | |
126 | 136 | | |
| |||
135 | 145 | | |
136 | 146 | | |
137 | 147 | | |
| 148 | + | |
138 | 149 | | |
139 | 150 | | |
140 | | - | |
| 151 | + | |
141 | 152 | | |
| 153 | + | |
142 | 154 | | |
143 | 155 | | |
144 | 156 | | |
| |||
157 | 169 | | |
158 | 170 | | |
159 | 171 | | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
160 | 226 | | |
161 | 227 | | |
162 | 228 | | |
| |||
178 | 244 | | |
179 | 245 | | |
180 | 246 | | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
0 commit comments