Closed ghost closed 3 years ago
It says, and I will try it, hopefully it works:
In the browser environment it is not possible to use sockets to connect to arbitrary ports. As a special exception CheerpJ provides a custom HTTP/HTTPS handler (based on XHR) that can be used to get data over HTTP and use REST APIs.
To enable this handler please set the property java.protocol.handler.pkgs= com.leaningtech.handlers during the cheerpjInit call, for example:
cheerpjInit({javaProperties:["java.protocol.handler.pkgs=com.leaningtech.handlers"]});
Why isn't this enabled by default? Does it support GET with a query part? Or do I have to use POST? Do you have some more extensive documentation?
Anyway good thing I asked. Was already a little desperate. I hope there will be a happy ending!
I trying to run a little example on http://foo/bar.html and the Java code makes a connection to http://foo/baz.rsc . But URLConnection will refuse to work. I investigated a little bit. It seems that the CheerpJ runtime only
installs a virtual file system that allows access over /app which does HTTP requests under the hood, but it seems it doesn't install an URLConnection factory. Are there versions of CheerpJ that also provide an
preconfigured URLConnection factory?