-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use kindling instead of defunct proxied package (#1480)
--------- Co-authored-by: Eli Yukelzon <[email protected]>
- Loading branch information
1 parent
6808309
commit da99f0c
Showing
42 changed files
with
147 additions
and
2,223 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package common | ||
|
||
import ( | ||
"net/http" | ||
"sync" | ||
|
||
"github.com/getlantern/kindling" | ||
) | ||
|
||
var httpClient *http.Client | ||
var mutex = &sync.Mutex{} | ||
|
||
// These are the domains we will access via kindling. | ||
var domains = []string{ | ||
"api.iantem.io", | ||
"api.getiantem.org", // Still used on iOS | ||
"geo.getiantem.org", // Still used on iOS | ||
"config.getiantem.org", // Still used on iOS | ||
"df.iantem.io", | ||
"raw.githubusercontent.com", | ||
"media.githubusercontent.com", | ||
"objects.githubusercontent.com", | ||
"replica-r2.lantern.io", | ||
"replica-search.lantern.io", | ||
"update.getlantern.org", | ||
"globalconfig.flashlightproxy.com", | ||
} | ||
|
||
func GetHTTPClient() *http.Client { | ||
mutex.Lock() | ||
defer mutex.Unlock() | ||
if httpClient != nil { | ||
return httpClient | ||
} | ||
|
||
// Set the client to the kindling client. | ||
k := kindling.NewKindling( | ||
kindling.WithLogWriter(log.AsStdLogger().Writer()), | ||
kindling.WithDomainFronting("https://raw.githubusercontent.com/getlantern/lantern-binaries/refs/heads/main/fronted.yaml.gz", ""), | ||
kindling.WithProxyless(domains...), | ||
) | ||
httpClient = k.NewHTTPClient() | ||
return httpClient | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.