Git Product home page Git Product logo

Comments (15)

Ghost-chu avatar Ghost-chu commented on May 31, 2024 1

后面看看吧,也弄了不止一次这个 GraalVM 过,光架工具链就令人头皮发麻。Windows 下面环境就没配成过,唯一一次构建成功还是在 WSL 里折腾的。

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024

Unirest 里面是包的 Apache HttpClient。
之前也试过用 GraalVM 编译带 Unirest 的 Native Image,都是直接爆掉,但是我看里面也没有什么黑魔法,这个就很奇怪。

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024

🤔主要是 Unirest 那个 Cookies 管理方便一些,它自己就能处理好了。如果不用那个 Cookies 管理,也可以不用 Unirest 的。

from peerbanhelper.

iceBear67 avatar iceBear67 commented on May 31, 2024

Cookies 管理

你是说自动接收存储 cookies?

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024

Author

对,qBittorrent 来说鉴权是基于 Session 的,要用到 Cookies,如果是基于 Token 大概就没这么多事情了,Java 自己的就够用了。

from peerbanhelper.

iceBear67 avatar iceBear67 commented on May 31, 2024

https://docs.oracle.com/javase/8/docs/api/java/net/CookieManager.html

我记得 Java 的那个 Modern HTTP 也可以直接给 CookieManager 来着,记得不知道什么时候用过

from peerbanhelper.

iceBear67 avatar iceBear67 commented on May 31, 2024

https://docs.oracle.com/en%2Fjava%2Fjavase%2F11%2Fdocs%2Fapi%2F%2F/java.net.http/java/net/http/HttpClient.Builder.html#cookieHandler(java.net.CookieHandler)

是这个

from peerbanhelper.

iceBear67 avatar iceBear67 commented on May 31, 2024

不过我感觉那个报错大概还会和 graal 有点关系(
水太深了

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024

image

折腾了一天,暂时能跑起来,但是网络请求(Unirest)似乎存在严重问题,看了2个小时没有定位出原因,先睡了。

NativeImage 工程在 https://github.com/Ghost-chu/PeerBanHelper/tree/test 上进行,构建输出在 Github Actions 里。

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024

晚点看看有没有必要换成新版 Java 自带的 HttpClient

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024

image

看起来不错

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024

测试了一下 Linux 二进制,看起来也没问题了

image

macOS 没有设备和环境,就不测试了

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024
15d3e252b52aa614aa1ab7bc4b050488

NativeImage 的体积,RAM占用和启动速度确实非常优秀。

from peerbanhelper.

Ghost-chu avatar Ghost-chu commented on May 31, 2024

从 2.3 开始本地二进制文件可用。
https://github.com/Ghost-chu/PeerBanHelper/releases/latest

from peerbanhelper.

iceBear67 avatar iceBear67 commented on May 31, 2024

好也

from peerbanhelper.

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.