portifi
A powerful reverse proxy redirecting multiple protocols on a same port.
Features
- Redirect network traffic from ONE port with multiple protocols:HTTP1.1/ HTTP/2(gRPC)/ redis
- Use as a SDK or deploy as a standalone proxy
Usage Scenarios
- Protocol Upgrade: Adopt a newer/better protocol to strengthen your app without changing origin behaviors. HTTP/1.1 -> gRPC etc.
- Unary Gateway: Act as an all-in-one gateway to hide the complex topology of internal system.
- FaaS Negotiator Component : Talk to different 3rd-party systems with ZERO configuration.
- Faraway from Legacy Systems: No need to modify DNS or protocol’s config of those corrupt apps.
Quick Start
You can take a look at examples and run a portifi
server quickly.
Or read this quick start.
Prerequisite
- JDK: 8 or higher
Add Portifi
to your project’s build.gradle.kts
.
dependencies {
implementation("io.github.gh:portifi:x.y.z")
}
Start Portifi
server to proxy HTTP(8080) on port 9999
.
fun main() {
ProxySpecBuilder(8080)
.protocol(Protocol.HTTP1_1)
.build()
.asServer()
.start(9999)
}
Start a backend HTTP server at 8080 (python3 as a sample).
$ python3 -m http.server 8080
Run a test
$ curl localhost:9999