StarBrowser
- 5 Devlogs
- 9 Total hours
A Web browser made in rust
A Web browser made in rust
Added Protocol::connect_tls() method using rustls::StreamOwned<rustls::ClientConnection, TcpStream>.
Created AllowAnyVerifier implementing rustls::client::danger::ServerCertVerifier to accept any certificate
AddedClient::connect_tls() that loads ca-certificates.crt if present otherwise falls back to system certs
TLS now works for HTTP1_1 and HTTP2_0 protocols
New DNSCache struct with Arc<Mutex<HashMap<String, DNSCacheEntry»> thread-safe, TTL-based
DNSCacheEntry stores resolved SocketAddr list + expiry timestamp
resolve_dns() now uses trust_dns_resolver::Resolver::from_system_conf() for proper DNS lookups, with fallback to ToSocketAddrs
parse_url() extracts the host, port, and TLS flag from http:// or https:// URLs
Handles explicit ports (example.com:8080) and defaults (80/443)
connect_to() now calls resolve_and_connect() which uses DNS cache + TLS decision logic
Client now tracks redirect_count
send_request() detects 3xx status codes, reads location header, and follows redirects
HTMLTag -enum of all standard HTML5 tags
HTMLAttribute -name/value pairs
HTMLNode - tag + attributes + children + optional text content
HTMLDocument -doctype + root node
HTMLTag::from_string() - case-insensitive parser for all tags
I added text rendering to the wgpu window so it displays the HTTP status code instead of just printing it to the console. The window now shows “Status: 200” (or whatever the server returns)
I added response decoding and support for http0.9 1.0 and 1.1. These guides: browser.engineering, firefox guides and servo were amazing resources for learning how HTTP works and with encoding/decoding requests and responses. I mostly just followed along with how firefox worked and built my way away from it but the code formatting went a bit off in the middle (it was 4:30am I have an exam in 4 hours I was tired)
Next I want to print everything in the UI instead of terminal
Added the initial browser engine foundataion. I added basic support for http protocol and implemented http request encoding.
I created the basic app here but it just shows a colour right now. I was following a tutorial on basic rust because I’m still learning it.