About the CSPro Local web server

Discussions about CSEntry
Post Reply
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

About the CSPro Local web server

Post by htuser »

Dear CSPro,
Thanks a lot for allowing us to have a way for using any javascript libraries in CSPro apps, mainly thoses from webassembly.
Also this allow me to test the local embedded web server in Chrome or Edge browser when opening any HTML pages using view on localhost. However, when i use the IP of the testing machine i can't reach theses pages.
So, i would like to know:
a) There's a workaround for accessing to the testing machine local web server on any LAN using it's IP?
b) There's a way to give us another argument in the view function, so we can define the port of the web server(and not having the random/dynamic port)?
c) It seem that you're using lfs as local web server since i always see http://localhost:63777/lfs Or cpp-httplib?

This is very important since, it can allow us to have some basic CAWI features using CSPro.
Thanks in advance for your help and support.
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1792
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: About the CSPro Local web server

Post by Gregory Martin »

On Windows, we are indeed using cpp-httplib. When accessing something on the local file system, we create a URL like:
http://localhost:<port>/lfs/<volume>/<path-to-file-on-volume>
The port is dynamically calculated based on open ports. I suppose we could offer an option to allow users to specify it, but I'm curious about what exactly you're trying to do. I haven't tested this with anything other than HTML pages on the local file system and external web pages. Are you saying that the web browser can't navigate to pages using IP addresses?
htuser
Posts: 631
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: About the CSPro Local web server

Post by htuser »

Thanks Greg for your support.
I'm working on an external HTML form. I'm using view to display it. Once it's displayed in the CSEntry webview, I can see it's possible to display it in Chrome and Edge browser using http://localhost:<port>/lfs/<volume>/<path-to-file-on-volume>
But, when i replace the localhost by the local IP of the machine: http://10.0.0.43:<port>/lfs/<volume>/<path-to-file-on-volume>, it doesn't display anymore.
but I'm curious about what exactly you're trying to do
Since i can easily find a way to transfer data from any HTML form to the CSEntry apps (using for example writecase or sql insert into), i'm trying to implement a basic CAWI sample... Even if you don't implement the CAWI soon, we'll be able to do something if you externalize more, some CSPro libs as wasm/javascript.
G.VOLNY, a CSProuser from Haiti, since 2004
Gregory Martin
Posts: 1792
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: About the CSPro Local web server

Post by Gregory Martin »

I believe that only localhost (127.0.01) IP addresses are going to be routed to our local web server. See here for an explanation that describes why this is a security feature:

https://unix.stackexchange.com/question ... -localhost
Post Reply