ascii-chat
Binary v0.16.50-198-g78f51665f
Library lib/v0.3.2-2240-g78f51665f
Video chat in your terminal
Loading...
Searching...
No Matches
url.c File Reference

Production-grade URL parsing and validation using PCRE2. More...

Go to the source code of this file.

Functions

void url_redact_diagnostic (char *text, bool truncated)
asciichat_error_t hostname_to_ascii (const char *hostname, char *output, size_t capacity)
bool url_is_valid (const char *url)
 URL validation using shared parsing and ICU hostname checks.
asciichat_error_t url_parse (const char *url, url_parts_t *parts_out)
 Parse HTTP(S), WebSocket, and TCP URL into components.
void url_parts_destroy (url_parts_t *parts)
 Free parsed URL components.
bool url_is_websocket_scheme (const char *scheme)
 Check if URL scheme is WebSocket (ws or wss).
bool url_is_websocket (const char *url)
 Check if a URL string is a valid WebSocket URL.
bool url_looks_like_websocket (const char *url)
 Quick check if a string is a WebSocket URL.
bool url_is_tcp_scheme (const char *scheme)
 Check if URL scheme is TCP.
bool url_is_tcp (const char *url)
 Check if a URL string is a valid TCP URL.
bool url_looks_like_tcp (const char *url)
 Quick check if a string is a TCP URL.

Detailed Description

Production-grade URL parsing and validation using PCRE2.

Implements robust HTTP(S) URL validation using the production-grade regex by Diego Perini (MIT License), compiled with PCRE2.

Definition in file url.c.