You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 13, 2024. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+24-18Lines changed: 24 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,18 +2,20 @@
2
2
3
3
##### Listen to the outside world 🌍 from your bedroom 🛌 — 📡 HTTP request forwarding with no hassle
4
4
5
-
Hermes is a dev tool designed to help teams to collaborate in the use of third party services that emit HTTP requests and need to be forwarded to the local machines.
5
+
Hermes is a dev tool designed to help teams to collaborate in the use of third party services that emit HTTP requests and need to be forwarded to your team's local machines. It provides a multi-users alternative to [ngrok](https://github.com/nclsndr/hermes#why-not-use-ngrok) or localtunnel.
You have an online service that need to hit your local server (e.g. webhooks). Basically, your computer is connected to your personal network (behind your NAT), so your localhost is invisible from the outside world...
11
+
You are working on your local machine on a piece of code that need to listen from an online service — providing HTTP requests (e.g. webhooks, chatBot service...). Basically, your computer is connected to your personal network (behind your NAT), so your localhost is invisible from the outside world...
12
12
13
-
Then Hermes comes and provides two modules:
13
+
The solution is well known: you need a HTTP/SSH tunneling system that forwards the requests to your computer. It's perfect when you're alone! **But now, you are working as a team**and each developer is running his own instance of the code locally and he would like to receive the payloads also. By design tunneling systems are limited to communicate with one user at a time.
14
14
15
-
- The *bridge* is running on your remote server and listen to any *provider* requests
16
-
- The *adaptor* is running on your localhost and replicate all the requests to your *local server*
15
+
**Here comes Hermes** and provides two modules:
16
+
17
+
- The *bridge* is running on any of your servers online and listen to any *provider* requests
18
+
- The *adaptor* is running on each local machine and replicate all the requests to the *local server*
17
19
18
20
When the response is emitted from the *local server*, it brings the response back to the *provider* following the same logic.
19
21
@@ -26,19 +28,19 @@ This is the most basic case. It applies for a single developer working on his ma
Concurrency mode allows **concurrent calls among clients** (aka Adaptors). By default, the first response received from any client (*adaptor*) will be used as the final response for the *provider*. This feature is particularly useful for teams of developers working in parallel when the provider do not require a client-specific response.
socketPort:9000, // this port will be reused for the adaptor configuration
85
-
loggerLevel:'verbose', // 'info'
86
89
dashboard: { // for you to control your adaptors in real time
90
+
host:'localhost', // default '127.0.0.1'
87
91
port:8001, // port to access the dashboard
88
92
adminAuth: { // credentials to connect onto the dashboard
89
93
username:'admin',
90
-
password:'admin', //should be placed into .env
91
-
jwtSecret:'jiReKLKbTVA2qnjHun8ma2hgDcApuZ'//should be placed into .env also!
94
+
password:dotEnv.parsed.ADMIN_AUTH_PASSWORD, //Change it into your .env file!
95
+
jwtSecret:dotEnv.parsed.ADMIN_AUTH_JWT_SECRET//Change it also into your .env file!
92
96
}
93
97
},
98
+
loggerLevel:'verbose', // 'info',
94
99
defaultResponse: responseFallback // by default, hermes provide the fallback described above
95
100
})
96
101
```
97
102
103
+
**Notes:** If you plan to not use any internal routing system (Apache, Nginx...), you should set `httpHost`, `socketHost`, `dashboard.host` to `'0.0.0.0'` to expose your Bridge and Dashboard to the world.
98
104
99
105
#### 4. 🚀 Launch it!
100
106
@@ -110,7 +116,7 @@ $ node index.js
110
116
- DNS resolution for the socket endpoint is possible but not as easy as it seems. We recommend to use the IP for configuring the adaptor.
111
117
-[Heroku](https://www.heroku.com/) users, as far as the service doesn't allow multi-port exposure, hermes-bridge will not be compatible.
112
118
113
-
#### 5. 🖥 Dashboard: register your Adaptor(s)
119
+
#### 5. Dashboard: register your Adaptor(s)
114
120
115
121
Navigate to the URL (or IP:port) you set up for your Hermes *dashboard*. You should have something like:
116
122
@@ -125,7 +131,7 @@ You can now add a new *adaptor* with the auth token of your choice — you will
125
131
126
132
---
127
133
128
-
### 🛌 Adaptor: Local dev env
134
+
### 🛌 Adaptor: Your (local) development environment
129
135
The adaptor can be set in any dev environment that support NodeJS 8+.
130
136
131
137
> All the information provided here are gathered into this [example directory](https://github.com/nclsndr/hermes/tree/master/examples/basic-adaptor)
@@ -145,8 +151,8 @@ Create a `hermes.js` file.
145
151
constadaptor=require('hermes-adaptor')
146
152
147
153
adaptor.init({
148
-
bridgeHost:'my-hermes-bridge-domain.com',
149
-
bridgeSocketPort:9000,
154
+
bridgeHost:'YOUR_SERVER_IP', // if set to 0.0.0.0 in the Bridge config
155
+
bridgeSocketPort:9000,// the port you chose previously
150
156
localServerProtocol:'http',
151
157
localServerHost:'localhost',
152
158
localServerPort:8888,
@@ -170,7 +176,7 @@ You need to launch your local server too if you want the all system to do his jo
170
176
**Notes**
171
177
172
178
- We recommend to use [concurrently](https://www.npmjs.com/package/concurrently) in order to start your dev-server in parallel with the adaptor
173
-
- For setup testing, you can try a `curl http://my-bridge.com`, then you should receive the request on your adaptor console (verbose = true).
179
+
- For testing your setup, you can try a `curl http://YOUR_SERVER_IP:YOUR_HTTP_PORT`, then you should receive the request on your adaptor console (verbose = true).
0 commit comments