https://github.com/tagaryen/jsarchernet
network framework. http(s) server and client. supports openssl 1.3 (gmssl)
https://github.com/tagaryen/jsarchernet
encrypt-cer gmssl http https network openssl
Last synced: 6 months ago
JSON representation
network framework. http(s) server and client. supports openssl 1.3 (gmssl)
- Host: GitHub
- URL: https://github.com/tagaryen/jsarchernet
- Owner: tagaryen
- License: apache-2.0
- Created: 2025-07-15T11:07:35.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-07-25T08:21:22.000Z (6 months ago)
- Last Synced: 2025-07-25T13:00:02.211Z (6 months ago)
- Topics: encrypt-cer, gmssl, http, https, network, openssl
- Language: JavaScript
- Homepage:
- Size: 8.33 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jsarchernet
network framework. http(s) server and client, support openssl 1.3(gmssl)
## install
npm install jsarchernet
## examples
http client
``` js
const {http, HttpError} = require('jsarchernet')
let res = http.request("https://www.zhihu.com",
{
method: "GET",
headers: {"User-Token": "17c858a9d7574fc78f6dc5b404a20d88"}
});
console.log(res.statusCode)
console.log(res.body.toString('utf-8'))
```
http server
``` js
const {http, HttpError} = require('jsarchernet')
http.createHttpServer("127.0.0.1", 9607, 0, (req, res) => {
console.log(req.body.toString('utf-8'));
res.setBody('{"nihao":"hello"}');
}, (err) => {
console.error(err);
})
```