File tree 1 file changed +3
-10
lines changed
1 file changed +3
-10
lines changed Original file line number Diff line number Diff line change @@ -85,16 +85,10 @@ func Get_Torrent_From_Ipfs(mhash string) (data []byte, err error) {
85
85
/////////////////////////////////
86
86
// get the file first
87
87
//url := app.GlogchainConfigGlobal.IpFsGateway + "/ipfs/" + mhash
88
- ////log.Println("url", url)
89
- //resp, err := http.Get(url)
90
- //if err != nil {
91
- // log.Println(err.Error())
92
- // return
93
- //}
94
- //defer resp.Body.Close()
95
88
96
- // get from api instead of from gateway
97
- url := app .GlogchainConfigGlobal .IpFsAPI + "/api/v0/get?arg=" + mhash
89
+ // remember to config ipfs ( ipfs service ) to listen on 0.0.0.0 so that it can be accessed behind firewall,
90
+ // behind firewall: 127.0.0.1, external still accessed via app.GlogchainConfigGlobal.IpFsGateway
91
+ url := "http://127.0.0.1:8080/ipfs/" + mhash
98
92
//log.Println("url", url)
99
93
resp , err := http .Get (url )
100
94
if err != nil {
@@ -103,7 +97,6 @@ func Get_Torrent_From_Ipfs(mhash string) (data []byte, err error) {
103
97
}
104
98
defer resp .Body .Close ()
105
99
106
-
107
100
/////////////////////////////////
108
101
// load to torrent
109
102
//r := bytes.NewReader(data)
You can’t perform that action at this time.
0 commit comments