[PR #14] [MERGED] Remove the string replacement of the bind address/port #51

Closed
opened 2026-03-02 04:09:05 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/gen2brain/cam2ip/pull/14
Author: @iDigitalFlame
Created: 11/30/2018
Status: Merged
Merged: 11/30/2018
Merged by: @gen2brain

Base: masterHead: patch-1


📝 Commits (1)

  • 13385ba Remove the string replacement of the bind address/port

📊 Changes

1 file changed (+3 additions, -10 deletions)

View changed files

📝 handlers/html.go (+3 -10)

📄 Description

Removes the bind address in favor of using JS to auto detect the location and use auto detection instead. "window.location.host" will point to the proper endpoint.
If the server is at "10.10.10.10", 'new WebSocket("ws://" + window.location.host + "/socket");' would be created at "ws://10.10.10.10". The "window.location.host" property also includes the port number as well.
This should fix the current open issue with websockets on HTML not rendering properly when the "-bind" option is omitted.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/gen2brain/cam2ip/pull/14 **Author:** [@iDigitalFlame](https://github.com/iDigitalFlame) **Created:** 11/30/2018 **Status:** ✅ Merged **Merged:** 11/30/2018 **Merged by:** [@gen2brain](https://github.com/gen2brain) **Base:** `master` ← **Head:** `patch-1` --- ### 📝 Commits (1) - [`13385ba`](https://github.com/gen2brain/cam2ip/commit/13385ba650dd7fe06bcc6b40b299999948f399ed) Remove the string replacement of the bind address/port ### 📊 Changes **1 file changed** (+3 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `handlers/html.go` (+3 -10) </details> ### 📄 Description Removes the bind address in favor of using JS to auto detect the location and use auto detection instead. "window.location.host" will point to the proper endpoint. If the server is at "10.10.10.10", 'new WebSocket("ws://" + window.location.host + "/socket");' would be created at "ws://10.10.10.10". The "window.location.host" property also includes the port number as well. This should fix the current open issue with websockets on HTML not rendering properly when the "-bind" option is omitted. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 04:09:05 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cam2ip#51
No description provided.