Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

net-client

Simple network client

Requirement

  • libuv 0.10.x

  • buffer 0.2.0

Installation

$ clib install clibs/net
$ git clone https://github.com/joyent/libuv.git deps/libuv
$ checkout v0.10.25

Run tests

make test
./test

Example

static void 
imap_parser(net_t * net, size_t read, char * buf) {
  printf("%s\n", buf);
  printf("%zu\n", read);
}

int 
main(int argc, char *argv[]) {
  ssl_init();
  tls_ctx * ctx = tls_ctx_new();
  net_t * net = net_new("imap.gmail.com", 993); 
  net->read_cb = imap_parser;

  // convert this socket to ssl
  net_set_tls(net, ctx);
  net_connect(net);

  uv_run(net->loop, UV_RUN_DEFAULT);
}

License

MIT

About

extends libuv to support tls/ssl in a simpler API for clibs

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.