Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Socket failed to connect #241

Closed
dietrichmd opened this issue Dec 14, 2021 · 23 comments
Closed

Socket failed to connect #241

dietrichmd opened this issue Dec 14, 2021 · 23 comments

Comments

@dietrichmd
Copy link

Fresh install using docker-compose and apache2. I can access site and login, but everything I try to do is greeted with a Socket Failed to Connect error.

Please advise.

Thanks

@dietrichmd
Copy link
Author

here is proxypass info

ProxyPreserveHost On
ProxyPass /.well-known/ !
ProxyPass / http://192.168.1.11:4040/
ProxyPassReverse /.well-known/ !
ProxyPassReverse / http://192.168.1.11:4040/
Alias / http://192.168.1.11:4040/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/?(.*) "ws://localhost:4040/$1" [P,L]

@dietrichmd
Copy link
Author

Solved: proxy_wstunnel_module was not enabled. For those looking, its a2enmod proxy_wstunnel

@silentArtifact
Copy link

I'm having this issue, but only when attempting to stream off the local network. Everything else works. It's running from Docker on a Synology NAS.

@advplyr
Copy link
Owner

advplyr commented Feb 10, 2022

Running a reverse proxy? SSL?

@silentArtifact
Copy link

Yeah, reverse proxy set up through the DMS os itself, same with SSL. I've got the same thing done with Plex and a bunch of other containers, so I'm not sure what I should do with this.

@timbatog
Copy link

timbatog commented Feb 11, 2022 via email

@advplyr
Copy link
Owner

advplyr commented Feb 11, 2022

The difference is that audiobookshelf requires a web socket connection, so the reverse proxy config will probably not be the exact same as other media servers. In NGINX proxy manager there is a toggle for web sockets support.
image

@timbatog
Copy link

timbatog commented Feb 11, 2022 via email

@silentArtifact
Copy link

Agreed. For synology, I followed these steps:

  1. Open Control Panel > Application Portal
  2. Change to the Reverse Proxy tab
  3. Select the proxy rule for which you want to enable Websockets and click on Edit
  4. Change to the "Custom Header" tab
  5. Click Create > WebSocket
  6. Click Save

Now it works!

@advplyr
Copy link
Owner

advplyr commented Feb 11, 2022

Awesome, thanks for following up with your steps. It is still a bit messy, but I added your steps for synology and the screenshot for nginx proxy manager in the readme.
https://github.com/advplyr/audiobookshelf/blob/master/readme.md#reverse-proxy-set-up

@silentArtifact
Copy link

Hey, I should be thanking you for all the work you've done on this! It's exactly what I've been looking for, and I seriously appreciate all your effort!

@timbatog
Copy link

timbatog commented Feb 11, 2022 via email

@advplyr
Copy link
Owner

advplyr commented Feb 12, 2022

There is nothing setup for donations at the moment, but I appreciate your support!

@timbatog
Copy link

timbatog commented Feb 12, 2022 via email

@advplyr
Copy link
Owner

advplyr commented Feb 12, 2022

Too much pressure! If you follow the project and donate when that need arrives then that would be ideal.

@PoepieFloepie
Copy link

PoepieFloepie commented Jul 1, 2022

Agreed. For synology, I followed these steps:

  1. Open Control Panel > Application Portal

  2. Change to the Reverse Proxy tab

  3. Select the proxy rule for which you want to enable Websockets and click on Edit

  4. Change to the "Custom Header" tab

  5. Click Create > WebSocket

  6. Click Save

Now it works!

Not working for https,if I do this for the ios app,only http is working ( that I don't want for outside my network)

@adamk33n3r
Copy link

adamk33n3r commented Sep 7, 2022

Agreed. For synology, I followed these steps:

  1. Open Control Panel > Application Portal
  2. Change to the Reverse Proxy tab
  3. Select the proxy rule for which you want to enable Websockets and click on Edit
  4. Change to the "Custom Header" tab
  5. Click Create > WebSocket
  6. Click Save

Now it works!

Not working for https,if I do this for the ios app,only http is working ( that I don't want for outside my network)

Same, I'm trying to use https through reverse proxy (so the app still receives via http) and in the Android app it fails to ping and replaces what I've typed with http. It works fine if I connect from http but obviously I'd prefer to use https for everything.

Edit: I take it back that "it works fine". It does go to the login screen, but I am getting "Unknown error" when I try to log in.

@SyndicatedPillbug
Copy link

Agreed. For synology, I followed these steps:

  1. Open Control Panel > Application Portal
  2. Change to the Reverse Proxy tab
  3. Select the proxy rule for which you want to enable Websockets and click on Edit
  4. Change to the "Custom Header" tab
  5. Click Create > WebSocket
  6. Click Save

Now it works!

I'm missing the other information for this, though! What ports do I need to use? It's like the first half of the instructions are missing for this reverse proxy thing.

@onthecliff
Copy link

Agreed. For synology, I followed these steps:

1. Open Control Panel > Application Portal

2. Change to the Reverse Proxy tab

3. Select the proxy rule for which you want to enable Websockets and click on Edit

4. Change to the "Custom Header" tab

5. Click Create > WebSocket

6. Click Save

Now it works!

Thank you this worked immediately!

@coracoo
Copy link

coracoo commented Jun 16, 2023

great ,It work .

@guhanmathi
Copy link

guhanmathi commented Aug 16, 2023

The difference is that audiobookshelf requires a web socket connection, so the reverse proxy config will probably not be the exact same as other media servers. In NGINX proxy manager there is a toggle for web sockets support. image

This helped in fixing my service showing socket errors running through nginx

@m4tz3
Copy link

m4tz3 commented Nov 10, 2023

grafik
grafik
grafik

DSM Changed a bit. could somebody share some screenshots with me? it's still not running at all for me

@robinjoseph08
Copy link

For posterity, just wanted to recount my experience here too, in case it helps someone else. I'm using a Synology NAS with DSM 7.2. I have ABS deployed using Container Manager, and it all works fine on my local network. I originally had ABS exposed publicly using Web Station (since that's also how I have Jellyfin exposed), but even though I could load it using my domain, it would always show the "Socket failed to connect" error.

Following these instructions, I deleted the entry for ABS in Web Station (since it doesn't seem like Web Station really has support for websockets yet) and instead went to the Reverse Proxy settings (now found in Control Panel > Login Portal > Advanced), and added entries for both HTTP and HTTPS for ABS, making sure to add the Websocket custom headers mentioned in this comment. After doing that, I was able to get ABS to connect to the socket without issue!

One thing I wanted to note though is that for some reason, if I try to access my domain when I'm on my local network, it's painfully slow, sometimes it times out, and the socket connection is very spotty. If I switch to just using the local IP of my NAS, everything is snappy and reliable again, and if I connect to the domain from a different network, it's also snappy. I mention this since it was messing up my testing a little bit because even after I fixed things with the Reverse Proxy settings, using my domain on my local network was still having issues, so I had to test it on a different network to see that it was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests