百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

curl-unity

> 编程语言
开源

这是一个用于 Unity 的 C# 封装,可使用已启用 http/2 和 openssl 的 libcurl。

99 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

这是一个用于 Unity 的 C# 封装,可使用已启用 http/2 和 openssl 的 libcurl。

curl-unity

This is a C# wrapper for Unity to use libcurl with http/2 and openssl enabled.

Prebuilt platforms

  • Windows x64
  • macOS 64bit
  • iOS arm64
  • Android armv7/arm64/x86

Libraries

Name Version
curl 7.67.0
nghttp2 1.39.2
openssl 1.1.1b

Build

Requirements

  • CMake is required for all platforms.
  • NDK r16b is required for Android.
  • Xcode is required for macOS/iOS.
  • Visual Studio 2017 is required for Windows.

Scripts

There are several build script under build folder for each platform:

All the scripts will auto deloy the output files into Assets/curl-unity/Plugins.

make_android.sh

Build libcurl.so for Android. Please use this script on macOS but it should also works on Linux.

make_ios.sh

Build libcurl.a for iOS. Please use this script on macOS

make_osx.sh

Build curl.bundle for macOS. Please use this script on macOS.

make_win.bat

Build curl.dll for Windows. Please use this script on Windows.

Install

Copy Assets/curl-unity to anywhere under your Unity project and done.

Optional

For a better performance you could enable Allow unsafe code and add ALLOW_UNSAFE to the Scripting Define Symbols in the project settings.

Usage

Select single thread/mutli thread mode

A CurlMultiUpdater component is needed to be created before any request and then you could check multiThread on or not.

Non-blocking multi perform

Only by using this multi perform that could take the advantage of HTTP/2 multiplexing feature.

csharp
void Start()
{
    for (int i = 0; i  Not recommended. You should take care of the thread safe issues and it can't be canceled before done.

```csharp
async void Start()
{
    var easy = new CurlEasy();
    easy.url = "https://nghttp2.org";
    easy.timeout = 5000;
    if (await easy.PerformAsync() == CURLE.OK)
    {
        Debug.Log(easy.inText);
    }
}

Blocking easy perform

csharp
void Start()
{
    var easy = new CurlEasy();
    easy.url = "https://nghttp2.org";
    easy.timeout = 5000;
    if (easy.Perform() == CURLE.OK)
    {
        Debug.Log(easy.inText);
    }
}

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言