+2

Preview Port

anonymous 5 years ago in General updated by Craig Morey 4 years ago 2

Does the localhost server for the html preview in Safari always use the same port?  This is required by the same origin policy if a website stores data in local storage, indexeddb, cache storage, etc. and wants to retrieve it later.  I noticed that Working Copy uses a different port with each preview, making testing javascript single page apps that utilize data storage impossible and was wondering if Textastic had a way to always use the same port when previewing html/js.

Currently, Textastic uses a new random port every time the web server is started.

I’d like to put my vote behind being able to set a port (or at least the port being stable), because a lot of my work revolves around authorisation systems (eg Google log-in), where you have to pre-determine the hosts/ports to allow sign-in (eg http://localhost:3001).

Thanks!