liuhulu
liuhulu
后来问题解决了么?我也一直有这个问题。
我发现是jdk问题,我使用jdk8没有这个问题了,但是用openjdk11还是有问题。 @fanyong920
> success! > > download code and modify it > Class Page#client() . make it public > > ```java > public CDPSession client() { > return client; > } >...
fyi,https://www.npmjs.com/package/puppeteer-extra-plugin-stealth
if(Thread.currentThread().isInterrupted()){ return; } 修改结束为返回,即可。
方案一,简单,粗暴,改动一般。 1,把所有操作绑定在一个对象身上。假设这个对象叫Robot。 2,Main.start中通过Robot.getBitmap/Robot.getTessactOcr/Robot.tap/Robot.xxx...【约定】来进行相关操作。 3,Main.start启动时,注入Robot对象。如,Main.setRobot(Robot).start(); 4,stop时Main.setRobot(null)即可。Main.start中操作Robot出现空指针异常,线程异常结束。 方案二,复杂,优雅,需要设计抽象类、接口和重构。 使用threadlocal绑定线程判定isInterrupted来决定是否执行操作。
> @liuhulu 目前就是第二种方案实现的,实现代码在https://github.com/Jinnrry/RobotHelper/blob/master/Android/app/src/main/java/cn/xjiangwei/RobotHelper/Service/RunTime.java 你没理解第二种的概念。这只是堆砌代码。直接继承thread自带这些方法。这个类改进空间非常大。 如果希望简单一些,可以使用future。
> @liuhulu 目前就是第二种方案实现的,实现代码在https://github.com/Jinnrry/RobotHelper/blob/master/Android/app/src/main/java/cn/xjiangwei/RobotHelper/Service/RunTime.java POC代码,没有测试,看下我的提交记录吧。 https://github.com/liuhulu/RobotHelper
本地windows7没有出现过这个问题,jdk17.0.8 服务器CentOS Linux release 7.9.2009 (Core) 上出现了这个问题。jdk17.0.2 proxyee 1.7.6 复现步骤 curl -i -x ip:port -U x:x https://www.baidu.com 第一次可以正常请求 curl -i -x ip:port -U x:x https://www.google.com 第二次 异常 curl: (56) Recv...
补充,局域网内没有问题,使用公网IP代理就有这个问题。 --- Supplement, there is no problem in the LAN, but there is this problem when using the public IP proxy.