https://github.com/aldor007/ngx_url_parser
Yet another url parser, written in C.
https://github.com/aldor007/ngx_url_parser
nginx ngx-url-parser parser uri uri-parser uriparser url url-parser
Last synced: about 2 months ago
JSON representation
Yet another url parser, written in C.
- Host: GitHub
- URL: https://github.com/aldor007/ngx_url_parser
- Owner: aldor007
- Created: 2015-11-25T22:03:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2018-07-12T11:58:44.000Z (almost 8 years ago)
- Last Synced: 2025-02-04T04:30:35.850Z (over 1 year ago)
- Topics: nginx, ngx-url-parser, parser, uri, uri-parser, uriparser, url, url-parser
- Language: Shell
- Homepage:
- Size: 183 KB
- Stars: 0
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://travis-ci.org/aldor007/ngx_url_parser)
[](https://coveralls.io/github/aldor007/ngx_url_parser?branch=master)
ngx_url_parser
==============
Yet another url parser, written in C.
This repository contains url parser extracted from source code of NGINX. There are some changes in code it but concept is same as in NGINX.
Usage:
----
Include ngx_url_parser.h and then
```C
const char * str = "https://user:password@mkaciuba.pl:555/path/?query#fragment";
// struct in which result will be stored
ngx_http_url url;
// run parser
int status = ngx_url_parser(&url, str);
if (status != NGX_URL_OK) {
printf("Error processing url!\n");
return 1;
}
printf("Url = %s\n", str);
printf("\nParse status %d", status);
printf("\n scheme = %s", url.scheme);
printf("\n Host = %s", url.host);
printf("\n Port = %s", url.port);
printf("\n Path = %s", url.path);
printf("\n Query = %s", url.query);
printf("\n Fragment = %s", url.fragment);
printf("\n Auth = %s", url.auth);
printf("\n");
// free memory
ngx_url_free(&url);
```