mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-05-30 23:40:40 +02:00
Socket failed to connect #127
Closed
opened 2026-04-24 22:59:04 +02:00 by adam
·
31 comments
No Branch/Tag Specified
master
book_tags_genres_dedupe
episode_download_fallback
Issue-4540-SortBy-StartedDate-and-FinishedDate
episode_meta_tagging
fix_authorize_race_condition
redirect_transcode_requests
progress_updated_sort
fix_ereader_socket_event
fix_change_empty_root_password
fix_podcast_session_track_index
fix_set_token
session_modal_user
localize_durations
fix_oidc_create_user
jwt_auth_refactor
fix_scanner_deleting_single_file_books
fix_mediaprogress_updatedat_2
experimental_next_client
podcast_episode_duration
episode-timestamps-clickable
book_author_secondary_sort_title
podcast_useragents
pathexists_user_access
fix_pathexists_join
book_author_secondary_sort
clean_duplicate_mediaprogress
sanitize_html_description
trix_prevent_attachments
check_path_api_fix
fix_mediaprogress_updatedat
increase_express_json_limit
fix_dockerfile_nunicode
search_episodes
audiobook_tools_update
episode_secondary_sorts
hls_stream_url_update
new_session_track_endpoint
audiobook_tools_enhancements
watcher_rescans_update
player_track_tooltip
fix_exclude_prefixes_crash
socket_item_events
fix_podcast_episode_scanner_promise
new_stats_controller
count_cache_for_userpermissions
parsing-opf-v3
validate_migration_files
fix-quick-match-all-crash
fix-chapter-end-sleep-timer
stringify_sequelize_query
remove-col-ambiguity
fix_next_prev_edit_description
details_trim_whitespace
fix_content_url_basepath
fix_logger_fatal
progress_bar_visibility
batch-edit-populate-map-details
feed_generator_updates
bookmark-modal-updates
migrate-library-item-in-scanner
migrate-new-library-items
migrate-podcasts-new-library-item-2
migrate-podcasts-new-library-item
fix-remove-episode-from-playlist
playback-session-use-new-library-item
refactor-library-item
fix-heatmap-caption
feed-episodes-upsert
share-media-player-media-session-api
remove-old-playlist
remove_old_collection_object
plugin-implementation-demo
feed_migration
refactor-feeds-from-item
fix_remove_authors_no_books
v2.17.3-fk-constraints-migration
migrations-first-upgrade
sqlite_2
feature/nuxt-target-server
waveform
sqlite
playlists
video
v2.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3
v1.3.1
v1.2.8
v1.2.6
v1.2.5
v1.2.4
v1.2.1
v1.1.15
v1.1.14
v1.1.13
v1.1.12
v1.1.11
v1.1.10
v1.1.9
v1.1.8
v1.0.0
0.9.61-beta.0
0.9.61-beta
Labels
Clear labels
authentication
backlog
bug
chapter editor
config-issue
ebooks
encoding/embedding
enhancement
help wanted
listening sessions & progress
planned
possible plugin
progress sync
pull-request
sorting/filtering/searching
unable to reproduce
upload
users & permissions
waiting
Mirrored from GitHub Pull Request
No Label
Milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
adam (Adam Melkus)
Clear assignees
No Assignees
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: starred/audiobookshelf#127
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dietrichmd on GitHub (Dec 14, 2021).
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 commented on GitHub (Dec 14, 2021):
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 commented on GitHub (Dec 14, 2021):
Solved: proxy_wstunnel_module was not enabled. For those looking, its a2enmod proxy_wstunnel
@silentArtifact commented on GitHub (Feb 10, 2022):
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 commented on GitHub (Feb 10, 2022):
Running a reverse proxy? SSL?
@silentArtifact commented on GitHub (Feb 11, 2022):
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 commented on GitHub (Feb 11, 2022):
I have they same issue with NGiNX
11 Feb 2022, 15:21 by @.***:
@advplyr commented on GitHub (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.

@timbatog commented on GitHub (Feb 11, 2022):
You did it! thank you!! (this needs to be on a sticky somewhere - it's so helpful)
11 Feb 2022, 22:26 by @.***:
@silentArtifact commented on GitHub (Feb 12, 2022):
Agreed. For synology, I followed these steps:
Now it works!
@advplyr commented on GitHub (Feb 12, 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 commented on GitHub (Feb 12, 2022):
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 commented on GitHub (Feb 12, 2022):
Agreed. This is excellent work!
Can I donate?
11 Feb 2022, 23:23 by @.***:
@advplyr commented on GitHub (Feb 12, 2022):
There is nothing setup for donations at the moment, but I appreciate your support!
@timbatog commented on GitHub (Feb 12, 2022):
Pick a charity maybe? I’ll donate :)
12 Feb 2022, 00:07 by @.***:
@advplyr commented on GitHub (Feb 12, 2022):
Too much pressure! If you follow the project and donate when that need arrives then that would be ideal.
@PoepieFloepie commented on GitHub (Jul 1, 2022):
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 commented on GitHub (Sep 7, 2022):
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 fromhttpbut obviously I'd prefer to usehttpsfor 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 commented on GitHub (Feb 1, 2023):
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.
@ghost commented on GitHub (Jun 11, 2023):
Thank you this worked immediately!
@coracoo commented on GitHub (Jun 16, 2023):
great ,It work .
@guhanmathi commented on GitHub (Aug 16, 2023):
This helped in fixing my service showing socket errors running through nginx
@m4tz3 commented on GitHub (Nov 10, 2023):
DSM Changed a bit. could somebody share some screenshots with me? it's still not running at all for me
@robinjoseph08 commented on GitHub (Jan 19, 2024):
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.
@rpgdev commented on GitHub (Jul 7, 2024):
This worked! Needed to wait a few minutes for the setting to take effect and audiobookshelf to tell me that it was able to connect the socket.
@soupy-boy commented on GitHub (Nov 15, 2024):
I had the same problem using typical nginx and not nginx proxy manager. Adding the following in the location portion of my .conf file fixed the issue, even when using ssl.
@kanine commented on GitHub (Nov 22, 2024):
Thanks @loganank these were the lines that made the difference for me:
@not-a-longneck commented on GitHub (Jan 9, 2025):
Thank you. That worked.
@lakestonelabs commented on GitHub (Jan 20, 2025):
For those using opnsense with the nginx plugin, I could not get my android client to play media. I could connect to the audiobookshelf server and see the bookshelf listing but when I pressed "Stream" I would get an error. What ended up being the root cause for me is that the opnsense nginx plugin automatically has a preset list of bot user agents applied to its auto-ban list. The 'okhttp' http client is being used by audiobookshelf client apps and this was on the bot list for auto-banning. As soon as I removed this from the bot list in the nginx pluygin and reloaded nginx, everything started working.
@rpgdev commented on GitHub (Jan 28, 2025):
@lakestonelabs thanks for sharing.. I'm setting up opnsense as we speak.
@kchism2020 commented on GitHub (Feb 3, 2025):
This fixed the issue for me, nginx rpm
@MilesTEG1 commented on GitHub (Dec 14, 2025):
Hello,
I'm exprimenting the same issue, and like @silentArtifact I only have this message when I'm on my LAN network:

When I accessed from outside, so from internet, websocket is connected:

But for me, Audiobookshelf is installed in docker inside a VM debian 13 (proxmox).
When I use SWAG as reverse proxy, I get the "Websocket failed to connect" message.
I also have AdGuardHome as DNS server inside my LAN, so I rewrite my domain name to point the reverse proxy.
my audiobbokshelf.conf file
But now, I set up a new reverse proxy with NPMplus:
And now, I don't have anymore the message about the websocket failed.
@advplyr Could you add NPMplus configuration in the doc?