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
This is a simple CORS proxy server designed to work with the TypingMind plugin. It allows you to make cross-origin requests to any API without worrying about CORS restrictions.
5
+
Based on: https://github.com/obeone/simple-cors-proxy
6
6
7
-
But it's not limited to TypingMind. You can use it with any application that requires a CORS proxy!
7
+
This is a simple CORS proxy server. It allows you to make cross-origin requests to any API without worrying about CORS restrictions.
8
8
9
9
## 🚀 Features
10
10
11
-
- 🌐 Seamless integration with external APIs using the TypingMind plugin
11
+
- 🌐 Seamless integration with external APIs
12
12
- 🔒 Secure authentication using an API key
13
13
- 🔗 Ability to proxy requests to any URL using the `X-Url-Destination` header or directly in the URL path
14
14
- 🔄 Handles CORS headers to enable cross-origin requests
15
+
- ✈️ Automatic preflight OPTIONS request handling (responds with 200 without proxying)
16
+
- 🔐 Supports credentials with `Access-Control-Allow-Credentials: true`
15
17
- ⚙️ Easy setup and configuration
16
18
- 🐳 Docker image available for quick deployment
17
19
18
-
## ⌨️ TypingMind Plugin
19
-
20
-
The TypingMind plugin is a powerful tool that enhances the capabilities of GPT. With the TypingMind plugin, GPT can seamlessly make calls to any API without being restricted by CORS (Cross-Origin Resource Sharing) policies. This allows GPT to access external data sources and services, opening up a wide range of possibilities for integration and interaction.
21
-
22
-
To use the TypingMind plugin, simply install go to the [TypingMind Plugin page](https://cloud.typingmind.com/plugins/p-01HMARRCP06S0B7Y6HRX1F9R0P) and click on Import.
23
-
24
20
## 🐳 Docker
25
21
26
22
You can use the Docker image to quickly run the proxy server. Here's how:
27
23
28
24
1. Pull the Docker image:
29
25
30
26
```shell
31
-
docker pull obeoneorg/simple-cors-proxy
27
+
docker pull mathiasvda/simple-cors-proxy
32
28
```
33
29
34
30
2. Run the Docker container:
35
31
36
32
```shell
37
-
docker run -d --name simple-cors-proxy -p 8080:8080 obeoneorg/simple-cors-proxy
33
+
docker run -d --name simple-cors-proxy -p 8080:8080 mathiasvda/simple-cors-proxy
38
34
```
39
35
40
36
## 🐳 Docker Compose
@@ -105,7 +101,7 @@ If you need to authenticate access to the proxy server, you can use the `PROXY_T
105
101
Example :
106
102
107
103
```shell
108
-
docker run -d --name simple-cors-proxy -p 8080:8080 -e PROXY_TOKEN=YOUR_API_KEY obeoneorg/simple-cors-proxy
104
+
docker run -d --name simple-cors-proxy -p 8080:8080 -e PROXY_TOKEN=YOUR_API_KEY mathiasvda/simple-cors-proxy
109
105
```
110
106
111
107
```shell
@@ -123,9 +119,21 @@ In both cases, if you need to remove multiple headers, you can use a comma-separ
123
119
So for example :
124
120
125
121
```shell
126
-
docker run -d --name simple-cors-proxy -p 8080:8080 -e HEADERS_TO_DELETE=X-Forwarded-For,X-Forwarded-Host obeoneorg/simple-cors-proxy
122
+
docker run -d --name simple-cors-proxy -p 8080:8080 -e HEADERS_TO_DELETE=X-Forwarded-For,X-Forwarded-Host mathiasvda/simple-cors-proxy
127
123
```
128
124
125
+
#### Preflight OPTIONS Requests
126
+
127
+
The proxy server automatically handles preflight OPTIONS requests for all routes. When an OPTIONS request is received, the server responds with a 200 status code and the appropriate CORS headers without proxying the request to the destination server. This includes:
128
+
129
+
-`Access-Control-Allow-Origin`: The origin from the request or `*`
This ensures smooth cross-origin requests from browsers without unnecessary round-trips to the destination server.
136
+
129
137
## 🤝 Contributing
130
138
131
139
Contributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue or submit a pull request on [GitHub](https://github.com/obeone/simple-cors-proxy).
0 commit comments