@stacksjs/rpx 0.3.1 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -62,13 +62,47 @@ const config: ReverseProxyOptions = {
62
62
  startProxy(config)
63
63
  ```
64
64
 
65
+ In case you are trying to start multiple proxies, you may use this configuration:
66
+
67
+ ```ts
68
+ // reverse-proxy.config.{ts,js}
69
+ import type { ReverseProxyOptions } from '@stacksjs/rpx'
70
+ import os from 'node:os'
71
+ import path from 'node:path'
72
+
73
+ const config: ReverseProxyOptions = {
74
+ https: { // https: true -> also works with sensible defaults
75
+ caCertPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.ca.crt`),
76
+ certPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt`),
77
+ keyPath: path.join(os.homedir(), '.stacks', 'ssl', `stacks.localhost.crt.key`),
78
+ },
79
+
80
+ etcHostsCleanup: true,
81
+
82
+ proxies: [
83
+ {
84
+ from: 'localhost:5173',
85
+ to: 'my-app.localhost',
86
+ },
87
+ {
88
+ from: 'localhost:5174',
89
+ to: 'my-api.local',
90
+ },
91
+ ],
92
+
93
+ verbose: true,
94
+ }
95
+
96
+ export default config
97
+ ```
98
+
65
99
  ### CLI
66
100
 
67
101
  ```bash
68
- reverse-proxy --from localhost:3000 --to my-project.localhost
69
- reverse-proxy --from localhost:8080 --to my-project.test --keyPath ./key.pem --certPath ./cert.pem
70
- reverse-proxy --help
71
- reverse-proxy --version
102
+ rpx --from localhost:3000 --to my-project.localhost
103
+ rpx --from localhost:8080 --to my-project.test --keyPath ./key.pem --certPath ./cert.pem
104
+ rpx --help
105
+ rpx --version
72
106
  ```
73
107
 
74
108
  ## Configuration
@@ -77,7 +111,7 @@ The Reverse Proxy can be configured using a `reverse-proxy.config.ts` _(or `reve
77
111
 
78
112
  ```ts
79
113
  // reverse-proxy.config.{ts,js}
80
- import type { ReverseProxyOptions } from './src/types'
114
+ import type { ReverseProxyOptions } from '@stacksjs/rpx'
81
115
  import os from 'node:os'
82
116
  import path from 'node:path'
83
117