{"id":14990009,"url":"https://github.com/timschumi/gmod-chttp","last_synced_at":"2025-10-04T23:35:46.107Z","repository":{"id":37880954,"uuid":"209351018","full_name":"timschumi/gmod-chttp","owner":"timschumi","description":"A HTTP()-compatible wrapper for curl in Garry's Mod.","archived":false,"fork":false,"pushed_at":"2024-05-15T20:59:49.000Z","size":1774,"stargazers_count":89,"open_issues_count":3,"forks_count":4,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-10T18:55:49.492Z","etag":null,"topics":["curl","garrysmod","libcurl"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timschumi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-18T16:08:00.000Z","updated_at":"2025-03-09T08:22:11.000Z","dependencies_parsed_at":"2024-05-15T16:42:59.338Z","dependency_job_id":"2acb9c04-e626-41f5-88eb-ff77082a0e6e","html_url":"https://github.com/timschumi/gmod-chttp","commit_stats":{"total_commits":314,"total_committers":4,"mean_commits":78.5,"dds":0.009554140127388533,"last_synced_commit":"220fa28ab1e51bfe3d075020cc748a1f0d9442da"},"previous_names":[],"tags_count":25,"template":false,"template_full_name":null,"purl":"pkg:github/timschumi/gmod-chttp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timschumi%2Fgmod-chttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timschumi%2Fgmod-chttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timschumi%2Fgmod-chttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timschumi%2Fgmod-chttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timschumi","download_url":"https://codeload.github.com/timschumi/gmod-chttp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timschumi%2Fgmod-chttp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266580298,"owners_count":23951193,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curl","garrysmod","libcurl"],"created_at":"2024-09-24T14:19:19.533Z","updated_at":"2025-10-04T23:35:41.073Z","avatar_url":"https://github.com/timschumi.png","language":"C++","funding_links":["https://paypal.me/schumact)!"],"categories":[],"sub_categories":[],"readme":"# gmod-chttp\n\nThis project aims to provide an open-source drop-in replacement for GMod's\nbuilt-in HTTP module. It provides the same interface as the original to\nallow for replacing it easily.\n\nThe module *should* provide all the functions that the original has\n(in terms of request methods and arguments).\nHowever, it doesn't yet behave like the original in all edge cases,\nespecially when it comes to deviating from the spec (for example just\nomitting the request body on DELETE requests).\n\nIf you like my work or otherwise profited from this module, consider\n[buying me a beer](https://paypal.me/schumact)!\n\n## Installation\n\nThe only thing required to install the library is to download the\nappropriate file from the [releases page](https://github.com/timschumi/gmod-chttp/releases) and\nputting it into the `\u003cgame or server directory\u003e/garrysmod/lua/bin/` directory.\n(The `bin` directory might not exist and should be created manually.)\n\nAttention has to be paid to whether you are using the 32-bit or 64-bit\nversion of the game/server. **Servers and clients are both 32-bit by default,\nunless manually changed by joining the appropriate beta.**\n\nThere are two other variations of the libraries, `-dbg` (with debugging symbols\nincluded) and `-static` (includes even less dynamically linked dependencies),\nas well as a combination of both.\n\nUnless you are bug-hunting (in the case of `-dbg`) or are having issues with\nloading the library due to dependencies (in the case of `-static`), you probably\nshouldn't use either of those (except when instructed to do so).\n\nPlease note that when using the library variants that have a suffix (`-dbg`, `-static`, ...),\nthat suffix has to be removed to match the expected library name.\n**The game will not find the library unless its exact name is `gmsv_chttp_\u003carch\u003e.dll`,\nwhere `\u003carch\u003e` is one of the following: `linux`, `linux64`, `win32`, `win64`.**\n\n## Configuration\n\n### CA bundle\n\n**Warning:** This section only applies to the Linux library. The Windows variant\nuses the native SSL backend inside Windows (also known as \"Schannel\" or \"WinSSL\")\nand as a result relies on the built-in certificate store.\n\nDue to differences across various Linux distributions CHTTP will search for an\naccessible CA bundle in the following locations (in this order) when the first\nrequest is made:\n\n* `/etc/ssl/certs/ca-certificates.crt` (Debian)\n* `/etc/pki/tls/certs/ca-bundle.crt` (Red Hat and Mandriva)\n* `/usr/share/ssl/certs/ca-bundle.crt` (Older Red Hat)\n* `/usr/local/share/certs/ca-root-nss.crt` (FreeBSD)\n* `/etc/ssl/cert.pem` (OpenBSD, FreeBSD)\n\nMost paths in this list should also apply to their respective derivatives, for example\nUbuntu as a Debian-derivative and Fedora/CentOS being based on Red Hat Enterprise Linux.\n\nIn case you are still having issues related to the CA bundle (for example receiving the\nerror `Problem with the SSL CA cert (path? access rights?)`) you can override the chosen\npath through the environment variable `CHTTP_CAINFO`.\n\nAs long as this environment variable is set, CHTTP will not search for the CA bundle\nitself. Instead, whatever value is provided will be\n[passed to libcurl as-is](https://curl.se/libcurl/c/CURLOPT_CAINFO.html) and no\nother checks will be made by CHTTP to verify that the provided value is valid.\n\n### Source Interface\n\n**Warning:** This should not be your go-to solution for fixing routing issues. Manually\nsetting the source interface can introduce weird issues if not done correctly, and the\noperating system is usually better at figuring out where traffic should go anyways.\nGo fix your routes.\n\nUsually, CHTTP will route your requests through the interface that is chosen by your\noperating system. In case the wrong interface is chosen and you can't fix your routing\ntable so that traffic is sent through the correct interface by default, you can\nforce CHTTP to pick a specific interface instead through the use of the\nenvironment variable `CHTTP_INTERFACE`.\n\nSetting this will override the interface using the variable contents for each request.\nThe value is passed to libcurl as-is and is not checked for validity by CHTTP,\nso make sure to review the documentation for\n[libcurl's CURLOPT_INTERFACE option](https://curl.se/libcurl/c/CURLOPT_INTERFACE.html).\n\n### Zero-delay timers\n\nCHTTP has switched to using a zero-delay timer instead of a hook to allow for running\nrequests while in singleplayer or while the server is hibernating.\n\nIn case there are any issues (bug reports greatly appreciated), you can return to\nusing the old hooking method by setting the environment variable `CHTTP_FORCE_HOOK`.\n\n### Update notifications and telemetry\n\nCHTTP automatically checks for new updates and transmits light telemetry data\nwhen the module is loaded. This behavior can be disabled by setting the\n`CHTTP_DISABLE_UPDATE_NOTIFICATION` and `CHTTP_DISABLE_TELEMETRY` environment\nvariables respectively.\n\nUnless both features are disabled (in which case no request is sent at all),\nthe current module version is always transmitted (for the purpose of checking\nif any newer versions are available).\n\nIf telemetry isn't disabled, the following additional properties are sent as well:\n\n* `build_target`: `win32`, `win64`, `linux` or `linux64`\n* `build_type`: `Release` or `Debug`\n* `build_static` `0` or `1` (depending on whether the `-static` file is in use)\n\nIf telemetry isn't disabled and the host OS is Linux, the following additional\nproperties are sent:\n\n* `os_sysname`: `Linux`\n* `os_release`: Linux kernel version (e.g. `6.5.7-arch1-1` on Arch Linux)\n* `os_version`: Linux kernel build string (e.g. `#1 SMP PREEMPT_DYNAMIC Tue, 10 Oct 2023 21:10:21 +0000`)\n* `os_machine`: Processor architecture (e.g. `x86_64`)\n* `dist_name`: Distribution name (e.g. `ubuntu`)\n* `dist_version`: Distribution version (if present; e.g. `22.04`)\n\nI'm collecting and aggregating this data for my own curiosity, as well as getting\nan informed guess on how fast updates propagate and what systems the module is run on.\nIf you have any feedback regarding either feature, feel free to leave it [here](https://github.com/timschumi/gmod-chttp/discussions/29).\n\n## Addon development\n\nThis is only required for developers who want to use CHTTP in their addons.\nA normal end user doesn't need any of this.\n\n### Loading the module\n\nThe module is loaded by running `require(\"chttp\")` in the LUA console or in\na script. It will provide a `CHTTP()` method that is called in the same way\nas the original HTTP-Method. For more information, please refer to the\n[Garry's Mod documentation](https://wiki.facepunch.com/gmod/Global.HTTP).\n\n### Automatic fallback to HTTP\n\nIf you want to use CHTTP when it's available and fall back to the built-in\nHTTP implementation otherwise you can use the following Lua snippet to load\nthe library:\n\n```\nif pcall(require, \"chttp\") and CHTTP ~= nil then\n\tmy_http = CHTTP\nelse\n\tmy_http = HTTP\nend\n```\n\nYou will now have a function called `my_http` that behaves like `HTTP()`/`CHTTP()`\nbut automatically points to the correct implementation.\n\n### Additional log output\n\nCHTTP can provide additional information about what is going on internally, which\nat the moment includes messages when a request or redirect is processed and when\ninvalid values in parameter or header tables are skipped.\n\nTo receive those messages in the console the developer log level has to be set to\na non-null value. This can be done by entering `developer 1` as a command, after\nwhich additional messages should start showing up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimschumi%2Fgmod-chttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimschumi%2Fgmod-chttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimschumi%2Fgmod-chttp/lists"}