This repository was archived by the owner on Jan 23, 2023. It is now read-only.
Commit d4853e2
authored
Use shared SocketsHttpHandler for some ClientWebSocket options (#27994)
* Use shared SocketsHttpHandler for some ClientWebSocket options
Currently we're creating a new SocketsHttpHandler for each ClientWebSocket. This change makes it so that if mostly default options are used (namely no credentials, no proxy, no cookies, and no client certificates), we'll use a shared handler instance.
* Make ClientWebSocketOptions.Proxy non-null by default
netfx's ClientWebSocketOptions.Proxy defaults to a system-default proxy. It can then be set to null to mean "no proxy" or to another proxy. This changes netcoreapp's Proxy to match as closely as possible.
It also then fixes up a few other settings on SocketsHttpHandler:
- UseDefaultCredentials wasn't being factored in. On netfx, UseDefaultCredentials takes precedence over Credentials, so this does the same.
- UseCookies should be true iff Cookies is non-null.
Finally, removed Outerloop from some tests that did not need to be, as they didn't actually involve making external requests, and deleted some dead test code.1 parent 9665203 commit d4853e2
File tree
8 files changed
+136
-122
lines changed- src/System.Net.WebSockets.Client
- src/System/Net/WebSockets
- tests
8 files changed
+136
-122
lines changedLines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
239 | 248 | | |
240 | 249 | | |
Lines changed: 63 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| |||
72 | 75 | | |
73 | 76 | | |
74 | 77 | | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
99 | 105 | | |
100 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
101 | 145 | | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
102 | 152 | | |
| 153 | + | |
103 | 154 | | |
104 | | - | |
105 | 155 | | |
106 | 156 | | |
107 | 157 | | |
108 | 158 | | |
109 | 159 | | |
110 | 160 | | |
111 | 161 | | |
112 | | - | |
| 162 | + | |
113 | 163 | | |
114 | 164 | | |
115 | 165 | | |
| |||
193 | 243 | | |
194 | 244 | | |
195 | 245 | | |
196 | | - | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
197 | 250 | | |
198 | 251 | | |
199 | 252 | | |
| |||
Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 0 additions & 20 deletions
This file was deleted.
Lines changed: 34 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | | - | |
8 | 6 | | |
9 | 7 | | |
10 | | - | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
| |||
19 | 16 | | |
20 | 17 | | |
21 | 18 | | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | 19 | | |
27 | 20 | | |
28 | 21 | | |
| |||
40 | 33 | | |
41 | 34 | | |
42 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
43 | 70 | | |
44 | 71 | | |
45 | 72 | | |
| |||
Lines changed: 0 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | 9 | | |
11 | 10 | | |
12 | 11 | | |
| |||
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 17 | | |
26 | 18 | | |
27 | | - | |
28 | 19 | | |
29 | 20 | | |
30 | 21 | | |
31 | 22 | | |
32 | 23 | | |
33 | 24 | | |
34 | 25 | | |
35 | | - | |
36 | 26 | | |
37 | 27 | | |
38 | 28 | | |
| |||
44 | 34 | | |
45 | 35 | | |
46 | 36 | | |
47 | | - | |
48 | 37 | | |
49 | 38 | | |
50 | 39 | | |
| |||
57 | 46 | | |
58 | 47 | | |
59 | 48 | | |
60 | | - | |
61 | 49 | | |
62 | 50 | | |
63 | 51 | | |
| |||
77 | 65 | | |
78 | 66 | | |
79 | 67 | | |
80 | | - | |
81 | 68 | | |
82 | 69 | | |
83 | 70 | | |
| |||
94 | 81 | | |
95 | 82 | | |
96 | 83 | | |
97 | | - | |
98 | 84 | | |
99 | 85 | | |
100 | 86 | | |
| |||
118 | 104 | | |
119 | 105 | | |
120 | 106 | | |
121 | | - | |
122 | 107 | | |
123 | 108 | | |
124 | 109 | | |
| |||
135 | 120 | | |
136 | 121 | | |
137 | 122 | | |
138 | | - | |
139 | 123 | | |
140 | 124 | | |
141 | 125 | | |
| |||
159 | 143 | | |
160 | 144 | | |
161 | 145 | | |
162 | | - | |
163 | 146 | | |
164 | 147 | | |
165 | 148 | | |
| |||
174 | 157 | | |
175 | 158 | | |
176 | 159 | | |
177 | | - | |
178 | 160 | | |
179 | 161 | | |
180 | 162 | | |
| |||
185 | 167 | | |
186 | 168 | | |
187 | 169 | | |
188 | | - | |
189 | 170 | | |
190 | 171 | | |
191 | 172 | | |
| |||
198 | 179 | | |
199 | 180 | | |
200 | 181 | | |
201 | | - | |
202 | 182 | | |
203 | 183 | | |
204 | 184 | | |
| |||
215 | 195 | | |
216 | 196 | | |
217 | 197 | | |
218 | | - | |
219 | 198 | | |
220 | 199 | | |
221 | 200 | | |
| |||
235 | 214 | | |
236 | 215 | | |
237 | 216 | | |
238 | | - | |
239 | 217 | | |
240 | 218 | | |
241 | 219 | | |
| |||
255 | 233 | | |
256 | 234 | | |
257 | 235 | | |
258 | | - | |
259 | 236 | | |
260 | 237 | | |
261 | 238 | | |
| |||
0 commit comments