From 94c92948ae7ae669b6b6466ef4b7f00cc430f7ef Mon Sep 17 00:00:00 2001 From: FChannel <> Date: Mon, 28 Jun 2021 11:08:15 -0700 Subject: added proxy wrapper with tor support --- client.go | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'client.go') diff --git a/client.go b/client.go index 91f5f1f..b7f1938 100644 --- a/client.go +++ b/client.go @@ -9,8 +9,6 @@ import "strings" import "strconv" import "sort" import "regexp" -import "io/ioutil" -import "encoding/json" import "os" var Key *string = new(string) @@ -241,43 +239,13 @@ func PostGet(w http.ResponseWriter, r *http.Request, db *sql.DB){ t.ExecuteTemplate(w, "layout", returnData) } -func GetRemoteActor(id string) Actor { - - var respActor Actor - - id = StripTransferProtocol(id) - - req, err := http.NewRequest("GET", "http://" + id, nil) - - CheckError(err, "error with getting actor req") - - req.Header.Set("Accept", activitystreams) - - resp, err := http.DefaultClient.Do(req) - - if err != nil || resp.StatusCode != 200 { - fmt.Println("could not get actor from " + id) - return respActor - } - - defer resp.Body.Close() - - body, _ := ioutil.ReadAll(resp.Body) - - err = json.Unmarshal(body, &respActor) - - CheckError(err, "error getting actor from body") - - return respActor -} - func GetBoardCollection(db *sql.DB) []Board { var collection []Board for _, e := range FollowingBoards { var board Board boardActor := GetActorFromDB(db, e.Id) if boardActor.Id == "" { - boardActor = GetRemoteActor(e.Id) + boardActor = FingerActor(e.Id) } board.Name = "/" + boardActor.Name + "/" board.PrefName = boardActor.PreferredUsername -- cgit v1.2.3