-
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Clear and concise description of the problem
As a developer I want to access different proxied paths and/or subdomains without having to add different ports for each.
Right now @stacksjs/rpx creates different listeners on different ports
import startProxies, { MultiProxyConfig } from "@stacksjs/rpx";
const config: MultiProxyConfig = {
https: true,
cleanup: {
hosts: true,
certs: true,
},
cleanUrls: false,
vitePluginUsage: false,
proxies: [
{
from: "localhost:3000",
to: "foo.myservice.local",
cleanUrls: true,
},
{
from: "localhost:3001",
to: "myservice.local/bar",
cleanUrls: false,
},
{
from: "localhost:3003",
to: "*.myservice.local",
cleanUrls: true,
},
],
verbose: false,
};
startProxies(config);
Output:
rpx v0.10.0
β localhost:3000 β https://foo.myservice.local
β SSL enabled with:
- TLS 1.2/1.3
- Modern cipher suite
- HTTP/2 enabled
- HSTS enabled
WARN Port 80 is in use, HTTP to HTTPS redirect will not be available 10:25:39 PM
WARN Port 443 is in use. Using port 8443 instead. 10:25:39 PM
βΉ You can use 'sudo lsof -i :443' (Unix) or 'netstat -ano | findstr :443' (Windows) to check what's using the port. 10:25:39 PM
rpx v0.10.0
β localhost:3001 β https://myservice.local
β Listening on port 8443
β SSL enabled with:
- TLS 1.2/1.3
- Modern cipher suite
- HTTP/2 enabled
- HSTS enabled
WARN Port 80 is in use, HTTP to HTTPS redirect will not be available 10:25:39 PM
WARN Port 443 is in use. Using port 8444 instead. 10:25:39 PM
βΉ You can use 'sudo lsof -i :443' (Unix) or 'netstat -ano | findstr :443' (Windows) to check what's using the port. 10:25:39 PM
rpx v0.10.0
β localhost:3003 β *.myservice.local"
β Listening on port 8444
β SSL enabled with:
- TLS 1.2/1.3
- Modern cipher suite
- HTTP/2 enabled
- HSTS enabled
It created 3 different servers listening on ports 80, 443, 8443 and 8444.
Suggested solution
Add a singlePortMode parameter that starts only one server in a configurable port (default to 80 and 443) and proxies all traffic based on the from parameter patterns.
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request