@@ -155,31 +155,21 @@ private Conductor(Builder builder) {
155155 String appName = dbosExecutor .appName ();
156156 Objects .requireNonNull (appName , "App Name must not be null to use Conductor" );
157157
158- var hostname = builder .domain ;
159- if (hostname == null ) {
158+ String domain = builder .domain ;
159+ if (domain == null ) {
160160 String dbosDomain = System .getenv ("DBOS_DOMAIN" );
161161 if (dbosDomain == null || dbosDomain .trim ().isEmpty ()) {
162- hostname = "cloud.dbos.dev" ;
162+ domain = "wss:// cloud.dbos.dev" ;
163163 } else {
164- hostname = dbosDomain .trim ();
164+ domain = "wss://" + dbosDomain .trim ();
165165 }
166+ domain += "/conductor/v1alpha1" ;
166167 } else {
167168 // ensure there is no trailing slash
168- hostname = hostname .replaceAll ("/$" , "" );
169+ domain = domain .replaceAll ("/$" , "" );
169170 }
170171
171- // Determine protocol based on hostname (use ws for localhost, wss for others)
172- boolean isLocalHost =
173- "localhost" .equals (hostname )
174- || hostname .startsWith ("localhost:" )
175- || "127.0.0.1" .equals (hostname )
176- || hostname .startsWith ("127.0.0.1:" );
177- var protocol = isLocalHost ? "ws" : "wss" ;
178-
179- this .url =
180- String .format (
181- "%s://%s/conductor/v1alpha1/websocket/%s/%s" ,
182- protocol , hostname , appName , builder .conductorKey );
172+ this .url = domain + "/websocket/" + appName + "/" + builder .conductorKey ;
183173
184174 this .pingPeriodMs = builder .pingPeriodMs ;
185175 this .pingTimeoutMs = builder .pingTimeoutMs ;
0 commit comments