mirror of https://github.com/JustKato/FreePad.git
Compare commits
No commits in common. "3a6c796cacaa818f023deab41ab03905a9801c44" and "ca10033ecf5d5f1dd2c4fddfbc6cf314e1658969" have entirely different histories.
3a6c796cac
...
ca10033ecf
23
README.md
23
README.md
|
@ -19,29 +19,6 @@ The project is absolutely free to use, you can extend the code and even contribu
|
||||||
|
|
||||||
The current maintainer and creator is `Kato Twofold`
|
The current maintainer and creator is `Kato Twofold`
|
||||||
|
|
||||||
# 🛑 About reverse proxying 🛑
|
|
||||||
If you are looking to reverse proxy this program, please keep in mind that the websockets have specific settings regarding reverse proxying, I have tried using `Apache2` but to no luck, if someone could give a suggestion as to how to set up my own program on `Apache2` it'd be amazing.
|
|
||||||
On `Nginx` it's rather simple, here is my reverse proxy for the demo at [pad.justkato.me](https://pad.justkato.me/)
|
|
||||||
```nginx
|
|
||||||
server {
|
|
||||||
# Define the basic information such as server name and log location
|
|
||||||
server_name pad.justkato.me
|
|
||||||
access_log logs/pad.justkato.me.access.log main;
|
|
||||||
|
|
||||||
# setup the reverse proxy
|
|
||||||
location / {
|
|
||||||
proxy_pass http://127.0.0.1:1626;
|
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
|
||||||
proxy_set_header Host $host;
|
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
||||||
|
|
||||||
# WebSocket support !! Important !!
|
|
||||||
proxy_http_version 1.1;
|
|
||||||
proxy_set_header Upgrade $http_upgrade;
|
|
||||||
proxy_set_header Connection "upgrade";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
![Gopher](static/img/banner_prerequisites.png)
|
![Gopher](static/img/banner_prerequisites.png)
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ func BindSocket(router *gin.RouterGroup) {
|
||||||
|
|
||||||
func webSocketUpgrade(ctx *gin.Context, padName string) {
|
func webSocketUpgrade(ctx *gin.Context, padName string) {
|
||||||
|
|
||||||
conn, err := wsUpgrader.Upgrade(ctx.Writer, ctx.Request, nil)
|
conn, err := wsUpgrader.Upgrade(ctx.Writer, ctx.Request, ctx.Request.Header)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Printf("Failed to set websocket upgrade: %v\n", err)
|
fmt.Printf("Failed to set websocket upgrade: %v\n", err)
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue