disable network access manager
This commit is contained in:
parent
f667c1ec70
commit
d019f3538f
17
main.go
17
main.go
|
@ -12,6 +12,8 @@ import (
|
||||||
"git.openprivacy.ca/openprivacy/libricochet-go/connectivity"
|
"git.openprivacy.ca/openprivacy/libricochet-go/connectivity"
|
||||||
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
"git.openprivacy.ca/openprivacy/libricochet-go/log"
|
||||||
"github.com/therecipe/qt/core"
|
"github.com/therecipe/qt/core"
|
||||||
|
"github.com/therecipe/qt/network"
|
||||||
|
"github.com/therecipe/qt/qml"
|
||||||
"github.com/therecipe/qt/quick"
|
"github.com/therecipe/qt/quick"
|
||||||
"github.com/therecipe/qt/quickcontrols2"
|
"github.com/therecipe/qt/quickcontrols2"
|
||||||
"github.com/therecipe/qt/widgets"
|
"github.com/therecipe/qt/widgets"
|
||||||
|
@ -63,6 +65,21 @@ func main() {
|
||||||
go characters.GroupPoller(gcd.UIState.GetContact, gcd.UIState.UpdateContact)
|
go characters.GroupPoller(gcd.UIState.GetContact, gcd.UIState.UpdateContact)
|
||||||
|
|
||||||
// here we go!
|
// here we go!
|
||||||
|
factory := qml.NewQQmlNetworkAccessManagerFactory()
|
||||||
|
factory.Create(nil)
|
||||||
|
factory.ConnectCreate(func(parent *core.QObject) *network.QNetworkAccessManager {
|
||||||
|
nam := network.NewQNetworkAccessManager(parent)
|
||||||
|
nam.SetNetworkAccessible(network.QNetworkAccessManager__NotAccessible)
|
||||||
|
proxy := network.NewQNetworkProxy()
|
||||||
|
proxy.SetHostName("0.0.0.0")
|
||||||
|
nam.SetProxy(proxy)
|
||||||
|
//nam.ConnectCreateRequest(func(op network.QNetworkAccessManager__Operation, originalReq *network.QNetworkRequest, outgoingData *core.QIODevice) *network.QNetworkReply {
|
||||||
|
// log.Errorf("network access request detected - possible remote content insertion bug!!!")
|
||||||
|
// return nil
|
||||||
|
//})
|
||||||
|
return nam
|
||||||
|
})
|
||||||
|
view.Engine().SetNetworkAccessManagerFactory(factory)
|
||||||
view.Show()
|
view.Show()
|
||||||
widgets.QApplication_Exec()
|
widgets.QApplication_Exec()
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue