HTTP/2 Support
Full native HTTP/2 support with server push, stream prioritization, and multiplexing. Built on Node.js http2 module with automatic HTTP/1.1 fallback.
On this page
HTTP/2 That Just Works
Enable HTTP/2 with one flag.
Server push, stream prioritization, and multiplexing included. HTTP/1.1 fallback automatic.
It's This Simple
Enable HTTP/2 with one flag
typescript
Why HTTP/2 Matters
Without HTTP/2, you're missing server push, multiplexing, and header compression. With MoroJS, you get all of that automatically.
Traditional HTTP/2 setup requires complex configuration. We handle that automatically.
Without HTTP/2
- •No server push capabilities
- •No multiplexing
- •No header compression
- •Slower page loads
With MoroJS
- •Built-in server push
- •Automatic multiplexing
- •HPACK header compression
- •Faster page loads
Why It Makes Sense
Faster
Server push for proactive resource delivery
Efficient
Multiplexing and header compression reduce latency
Compatible
Automatic HTTP/1.1 fallback for all clients
How It Works
HTTP/2 is a major revision of the HTTP protocol that provides better performance through server push, multiplexing, header compression, and stream prioritization. MoroJS provides native HTTP/2 support built on Node.js's http2 module, with automatic HTTP/1.1 fallback for clients that don't support HTTP/2.
Quick Start
Basic HTTP/2 Server
typescript
Advanced Configuration
typescript
Server Push
Automatic Push (Recommended)
typescript
Manual Push
typescript
Stream Prioritization
Priority Control
typescript
Priority Values Guide
typescript
SSL Certificates
Generate Self-Signed Certificate (Development)
typescript
Checking HTTP Version
Detect HTTP Version
typescript
Best Practices
1. Use Server Push Wisely
Only push resources that are:
- • Critical for initial render
- • Small in size (< 100KB)
- • Used by most users
2. Set Appropriate Priorities
3. Enable HTTP/1.1 Fallback
Features
Core Features
- Native HTTP/2 server
- Server push for proactive resource delivery
- Stream prioritization
- Multiplexing (multiple requests over single connection)
- HPACK header compression
- HTTP/1.1 fallback support
Benefits
- Faster page loads with server push
- Reduced latency with multiplexing
- Better resource prioritization
- Improved bandwidth utilization
- Backward compatible with HTTP/1.1