This page documents my experiments on how SAMP can be used from a Web Application served from an HTTPS, rather than HTTP, web page (I'm tentatively calling this the TLS Profile or tlsamp). This is not straightforward; see my presentations on the topic from Sydney, Edinburgh, Cape Town.
Below are some resources which give the results of my experiments to date, and some instructions on how you can try this out at home. In terms of functionality I believe it should work in the same way as the existing Web Profile, except (a) it will be slower (especially if you are far from the server) and (b) URL translation is not currently implemented, so you can't read data sent from desktop SAMP clients to TLS SAMP clients (most Web SAMP clients don't currently need to do that).
It's still not clear to me whether it makes sense to incorporate all this into a future version of the SAMP standard. That depends on input from other potential deployers of SAMP-from-HTTPS. If that's you, I'd like to know:
If you have input along these lines please contact me or discuss on the apps@ivoa.net or apps-samp@ivoa.net mailing list.
Or if all this sounds too complicated (which it is): you can look at sampload, a much dumber solution to part of the same problem.
java -jar tlshub.jar
These are example web applications based on the experimental TLS profile deployed on my HTTP/HTTPS servers.
For this you need to have a running servlet container (e.g. Tomcat) running from HTTPS (i.e. with a certificate). That's necessary because the TLS profile requires you to run a separate server component alongside the web application itself, in order to relay SAMP calls from the web app to the hub. It is possible to do that using a relay deployed on a different machine or using a standalone HTTPS server rather than a servlet container, but here I just document doing it from within the same servlet.
samp.js
,
you can just replace that with the tlsamp.js file above,
and modify the connector setup like this:
var connector = new samp.Connector(clientName, metaData); // This is the part that's required for use with HTTPS. // You need to set the connector profile property to an instance of // samp.TlsProfile, pointing to a hub relay XML-RPC server. // The value of relay here is the URL of the Relay servlet as // set up in the provided war file; adjust it if the relay has // a different URL. if (location.protocol === "https:") { var relay = baseUrl + "xmlrpc"; connector.profile = new samp.TlsProfile(relay); }