Coder Social home page Coder Social logo

Comments (8)

Peytonlan avatar Peytonlan commented on August 27, 2024 1
cd $GOPATH/src/github.com/phuslu/
rm -rf glog
git clone --depth 1 https://github.com/phuslu/glog

cd $BUILD_ROOT/goproxy/
grep RequestConnectionIDTruncation . -rl | xargs -I {} sed -i "s/RequestConnectionIDTruncation/RequestConnectionIDOmission/g" {}
grep DialTCPContext . -rl | xargs -I {} sed -i "s/DialTCPContext(ctx, network, nil, raddr)/DialTCPContext(ctx, network, nil, raddr, nil)/g" {}

from goproxy.

GLingDroid avatar GLingDroid commented on August 27, 2024

谢谢 Peytonlan
这两个问题已经解决
另外 is not using a known version control system 这个问题因为golang.org被墻,翻上去看好像指向文件的下载被转到github上了,网上搜到这个 https://golangtc.com/t/56f3c175b09ecc66b9000181
就是把 golang.org/x/ 替换成 github.com/golang/ ,把整个 crypto,net ,sys,text go get -u 下来,然后把整支拷贝到golang.org/x/下,
这样,编译能顺利通过,make一下就出来了。

但是,新的问题出来了,编译出来的比如windows下的程序出现错误异常。。。
log较长,贴图片看吧,唔

log

from goproxy.

Peytonlan avatar Peytonlan commented on August 27, 2024

抱歉, Windows几乎不用
Linux下的运行正常么
先确定下这个问题是否和平台有关

from goproxy.

GLingDroid avatar GLingDroid commented on August 27, 2024

没有linux,不过编了个android的试了下,情况是一样的

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x34 pc=0x2e9eb4]

goroutine 241 [running]:
github.com/phuslu/quic-go.(*streamFramer).maybePopNormalFrames(0x1246a900, 0x48e, 0x0, 0x0, 0x0, 0x0)
        /usr/src/goproxy/gopath/src/github.com/phuslu/quic-go/stream_framer.go:121 +0x1b4
github.com/phuslu/quic-go.(*streamFramer).PopStreamFrames(0x1246a900, 0x48e, 0x0, 0x0, 0x1, 0x11f1d650)
        /usr/src/goproxy/gopath/src/github.com/phuslu/quic-go/stream_framer.go:57 +0x70
github.com/phuslu/quic-go.(*packetPacker).composeNextPacket(0x12462c30, 0x499, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1200ed4c, 0x2e645c)
        /usr/src/goproxy/gopath/src/github.com/phuslu/quic-go/packet_packer.go:269 +0x320
github.com/phuslu/quic-go.(*packetPacker).PackPacket(0x12462c30, 0x0, 0x0, 0x0)
        /usr/src/goproxy/gopath/src/github.com/phuslu/quic-go/packet_packer.go:159 +0x170
github.com/phuslu/quic-go.(*session).sendPacket(0x11c85c00, 0xbe929701, 0x6b4ed659, 0x21)
        /usr/src/goproxy/gopath/src/github.com/phuslu/quic-go/session.go:826 +0x4c4
github.com/phuslu/quic-go.(*session).run(0x11c85c00, 0x0, 0x0)
        /usr/src/goproxy/gopath/src/github.com/phuslu/quic-go/session.go:434 +0xb8
github.com/phuslu/quic-go.(*client).establishSecureConnection.func1(0x123ec660, 0x120ccd28, 0x12500340)
        /usr/src/goproxy/gopath/src/github.com/phuslu/quic-go/client.go:216 +0x28
created by github.com/phuslu/quic-go.(*client).establishSecureConnection
       /usr/src/goproxy/gopath/src/github.com/phuslu/quic-go/client.go:215 +0x6c

可能原因是源码的改动部分,或者是引用的库quic-go版本问题导致有些变动?
update:试了下tls,暂时没错误,那可能是引用库问题。

from goproxy.

Peytonlan avatar Peytonlan commented on August 27, 2024

空指针的问题quic-go上游已修复, 等 @phuslu 同步上游代码, 或者手工打补丁
quic-go/quic-go@0b9d805

from goproxy.

GLingDroid avatar GLingDroid commented on August 27, 2024

Thank you @Peytonlan very much.
Now I could build a working application under your help.

My intention is to try reducing the battery consumption on mobile devices.

By modifying following parameters I can manager extending the screen on time from 50% to 70% and extending the stand by time from 20% to 90%.
gae.json:
KeepAlive 5 ---> 240
Level 8 ---> 3
Timeout 5 ---> 240
IdleConnTimeout 5 ---> 240
Here Timeout is looking for new good_addr ,so enlarge it is reduing the dail frequency which is good for screen on time and bad for downloading and sometimes you need to wait minutes under normal using.
IdleConnTimeout is reducing dial frequency in the background under system idle which related to stand by time.
Keep enlarging these has nothing better but worse to normal use.
So,I need two configuration file modified one for normal use and original one for download.

Even that compacts battery a lot.A normal use with SOT 10 hours reduced to 7 hours and even worse if you are moving that makes program dials more.

So,I looked into code to see whether there's some parameters can be modified.
Here came with two proposals.
One is modifying following parameters:
gae.go
line 309 KeepAliveTimeout 2 ---> 4
quic.go
line 40 IdleTimeout 10 ---> to some minutes

Another better one is change the dealing policy but much harder.
Only dial when it receives data request.
Just acting like the program started but now every time and only time it received the request,and keep a short time(it said 4 minutes allowed for gae of every ip?) with the picked good_addr from every selection.
A short time with full cpu power (even with every 4 minutes cycle) is much less battery consumption than keeping using data connection.

(Please excuse for sensitive reason that using english)

from goproxy.

GLingDroid avatar GLingDroid commented on August 27, 2024

grrr...
I've made a misunderstanding about the parameter "EnableDeadProbe" and its description in ConfigIntroduce.md is obscure.

Having a clear view of time related codes is hard for me ,so it's confusing when adjusting some of them after some tries.
So at the same time I'm seeking the second method that the protocol how it handles about sending and receiving datas. grrr...even harder.
Back to method one ,I've notice "isNetAvailable" just a few lines up "Timeout()" in gae.go of line 390.
It returns empty if false or dial roundtrip. A few lines up ,turns out the request I want.

Finally ,setting parameter "EnableDeadProbe" false in gae.json meets the "quiet at background dial at demond" and no need to change time related parameters.
The test shows it right meet the battery saving demand.

Cheer to phuslu.

About another tip is about the download .
If you feel unhappy with download using this product ,put // before "Default"- "RequestFilters" - "autorange" in httpproxy.json.
Yea,just don't use that and using ADM for the downloading .

from goproxy.

Peytonlan avatar Peytonlan commented on August 27, 2024
EnableDeadProbe 这个配置参数的确需要留意, 应该默认设为 false 要好些

from goproxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.