Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
[BUG] Socketio path is not dynamically adjusting correctly in edge cases (with fix proposal) | GoodFirstPicks

[BUG] Socketio path is not dynamically adjusting correctly in edge cases (with fix proposal)

frappe/frappe 2 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeFrappe / ERPNextPython

Why this is a good first issue

Socketio path handling fails in specific reverse proxy setups.

AI Summary

The issue involves incorrect socketio path handling in edge cases, particularly with reverse proxy setups. The path incorrectly includes port numbers and site names, which should be dynamically adjusted or configurable. The fix requires understanding of both the socketio client code and reverse proxy configurations.

Issue Description

this issue is related to this: https://github.com/frappe/frappe_docker/issues/1481 https://github.com/frappe/frappe_docker/issues/1783 https://github.com/frappe/frappe/issues/33159 https://github.com/frappe/frappe/issues/32436 https://github.com/frappe/frappe/issues/32436#issue-3043489310

Context:

  1. i am setting my own networking for frappe site,
  2. i set somekind of reverse proxy server in front of my frappe server.
  3. in edge cases like me the socketio fails to dynamically adjust.

To reproduce:

  1. first i bench new-site oldsite.com
  2. same basic setup bench install-app etc and so on...
  3. app is up and running, able to login but websockets failed to connect and fallback to polling.

after some debugging i got it working. so here i am just reporting it

refering to this code: https://github.com/frappe/frappe/blob/35c1cc0276f5849325a9370327a31762f920eb51/frappe/public/js/frappe/socketio_client.js#L116C1-L127C3

in my case this specific function returns subdomain.mysite.com:9000/sitename.com/socket.io/ when i was expecting subdomain.mysite.com/socket.io/

so 2 problem:

  1. there shouldn't be any port showing up
  2. path shouldn't contain sitename

below is the way i adjust it to work i need it to return host instead of host/sitename.com which is some random site i chose when creating bench new-site

i understand that the existing code is tring to cater the needs of multitenancy, but i think instead of assuming right away that the site is mutitenant with /sitename.com as path, perhaps there might be ways to dynamically autoadjust it or configure it maybe in common_site_config or smth? eg : socketio_path :"/" or "/{}"

in my case i did it like so:

get_host(port = 9000) {
    let host = window.location.origin;
    // somehow changing developer_mode 1 doesnt cause this windows.dev_server to change to false
    // causing the site to return <sitename>:<port>

    // dev_server originally indicates development vs production build mode, 
    // but netwo

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • reverse proxy setup
  • multitenancy assumptions
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno