()
| 196 | }; |
| 197 | |
| 198 | export const useProxy = (): ProxyContextValue => { |
| 199 | const context = useContext(ProxyContext); |
| 200 | |
| 201 | if (!context) { |
| 202 | throw new Error("useProxy should be used inside of <ProxyProvider />"); |
| 203 | } |
| 204 | |
| 205 | return context; |
| 206 | }; |
| 207 | |
| 208 | /** |
| 209 | * getPreferredProxy is a helper function to calculate the urls to use for a given proxy configuration. By default, it is |
no outgoing calls