Skip to content
Snippets Groups Projects
Commit a827185e authored by cyberta's avatar cyberta
Browse files

adapt hop client api, to start and stop hopping pt over FFI

parent 716d4fac
No related branches found
No related tags found
3 merge requests!26API Changes for android,!25API changes / Android integration,!24Draft: adapt hop client api for Android
Pipeline #136760 passed
......@@ -62,6 +62,11 @@ func NewHopClient(ctx context.Context, stop context.CancelFunc, kcp bool, proxyA
}
}
func NewDefaultHopClient(kcp bool, proxyAddr string, obfs4Endpoints []*Obfs4Config, minHopSeconds uint, hopJitter uint) *HopClient {
ctx, stop := context.WithCancel(context.Background())
return NewHopClient(ctx, stop, kcp, proxyAddr, obfs4Endpoints, minHopSeconds, hopJitter)
}
func (c *HopClient) Start() (bool, error) {
defer func() {
c.state = stopped
......@@ -300,20 +305,12 @@ func (c *HopClient) readTCPWriteUDP() {
}
}
func (c *HopClient) Close() error {
// TODO: implement
return nil
}
func (c *HopClient) Stop() (bool, error) {
if !c.IsStarted() {
return false, ErrNotRunning
}
if err := c.Close(); err != nil {
c.error("error while stopping: %v", err)
return false, err
}
c.stop()
c.state = stopped
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment