ayushsharma82 / WebSerial

A remote terminal library for wireless microcontrollers to log, monitor or debug your firmware/product
https://webserial.pro
GNU Affero General Public License v3.0
461 stars 108 forks source link

Use relative URL paths #20

Closed digislayer closed 1 year ago

digislayer commented 3 years ago

Thank you for making this modern utility accessible! Absolute URLs are used in multiple locations of the front-end. This makes the interface inaccessible in several use-cases where the device needs to be behind a NAT(for example, with a reverse-proxy).

Replacing these with relative URLs would make the interface work in such cases.

Example: WebSocket URL is defined in this way: "ws://" + document.location.host + "/webserialws" . document.location.host needs to be replaced here with document.location.host + document.location.port + document.location.pathname.

I could submit a PR with all the required changes, but the front-end is minified and it wouldn't make sense to submit a PR over minified content.

ayushsharma82 commented 2 years ago

Hi, The frontend is actually in the ui folder of the repository. It's compiled and minified for usage in a C++ library.

Your pull request will be highly appreciated. Here's the file you are looking for: https://github.com/ayushsharma82/WebSerial/blob/master/ui/src/socket.js

Thanks!