Skip to content

Fix Jellycuts Bridge local network permission and URL parsing - #29

Open
gscott82 wants to merge 1 commit into
OpenJelly:mainfrom
Scott-Tech-Industries:codex/fix-bridge-local-network
Open

Fix Jellycuts Bridge local network permission and URL parsing#29
gscott82 wants to merge 1 commit into
OpenJelly:mainfrom
Scott-Tech-Industries:codex/fix-bridge-local-network

Conversation

@gscott82

Copy link
Copy Markdown

Summary

This PR fixes two Jellycuts Bridge connection issues seen on iOS when connecting to a local VS Code bridge on the same Wi-Fi network:

  • Adds the iOS Local Network usage description and allows local networking through App Transport Security.
  • Normalizes Bridge server addresses before constructing the WebSocket URL.

Problem observed

A Windows 11 + iPhone test setup could reach the bridge from Safari and from an independent WebSocket probe, but the Jellycuts app itself did not establish a usable bridge connection.

Observed behavior:

  • The bridge was reachable at a local address such as 192.168.0.98:8080.
  • Safari could load the bridge health page over HTTP.
  • A WebSocket probe from the iPhone successfully connected to ws://192.168.0.98:8080.
  • The unpatched Jellycuts app did not appear under iOS Settings > Privacy & Security > Local Network.
  • The Jellycuts Bridge screen stayed disconnected/connecting even though the PC bridge was reachable.
  • When a URL scheme was included or inferred, the app could construct an invalid WebSocket URL because BridgeView always prepended ws:// to the stored server string.

Root cause

There appear to be two separate issues:

  1. iOS needs an explicit local-network permission string before the app can reliably request/appear in Local Network permissions.
  2. The bridge server address is treated as a raw host string, so values like http://192.168.0.98:8080 or ws://192.168.0.98:8080 can be transformed into invalid URLs such as ws://http://....

Validation

A local sideload test build with these two changes was installed on iPhone and verified against a VS Code/Jellycuts bridge running on Windows 11.

Results:

  • iOS prompted for Local Network permission.
  • Jellycuts LAN appeared in Settings > Privacy & Security > Local Network and could be enabled.
  • Adding a bridge as 192.168.0.98:8080 connected successfully.
  • VS Code/Jellycuts Support logged the iPhone client as connected.
  • Pulling .jelly content from the laptop to the iPhone worked.

Notes

This PR intentionally does not change Pro/subscription behavior and does not add save-back/sync-to-editor behavior. It only addresses the local connection path for the existing Jellycuts Bridge feature.

I could not run a local Xcode build on Windows. The changes were validated through a GitHub Actions iOS build of the fork and sideload testing on the iPhone.

@ActuallyTaylor

ActuallyTaylor commented May 7, 2026

Copy link
Copy Markdown
Member

@gscott82 Hi, your codex branch is not publicly available so it can't be reviewed. If you could make the code public I can review!

Comment on lines +42 to +61
private static func bridgeWebSocketURL(from rawAddress: String?) -> URL? {
guard var address = rawAddress?.trimmingCharacters(in: .whitespacesAndNewlines),
!address.isEmpty else {
return nil
}

let lowerAddress = address.lowercased()
if lowerAddress.hasPrefix("http://") {
address = String(address.dropFirst("http://".count))
} else if lowerAddress.hasPrefix("https://") {
address = String(address.dropFirst("https://".count))
}

let normalizedAddress = address.lowercased()
if normalizedAddress.hasPrefix("ws://") || normalizedAddress.hasPrefix("wss://") {
return URL(string: address)
}

return URL(string: "ws://\(address)")
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function should be moved into BridgeServer as it modifiers parts of the BridgeServer (URL).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay after re-looking at the code (its been a while), this code should actually be put into BridgeList view when the webserver entry is made into Core Data.

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

Successfully merging this pull request may close these issues.

2 participants