TCPSockets for Jasmine (and SqueakJS)
John <[email protected]>
| Newsgroups | gmane.comp.lang.smalltalk.squeak.general |
|---|---|
| Message-ID | <CAJLKUarSs_6ovmaawfccze+Vzv_W7jtxNEBvpMYAwpy52yUoJg@mail.gmail.com> |
Hi squeak-dev! I have been having big fun lately programming TCPSockets using Isolated Web Apps <https://chromeos.dev/en/web/isolated-web-apps> (and Newspeak) and want to let you all know that the technology could be used in Jasmine <https://github.com/codefrau/jasmine> to fix its networking situation (as explained in the last paragraph of the README). Running as an Isolated Web App, Jasmine would have access to Chrome's implementation of DirectSockets <https://wicg.github.io/direct-sockets>; TCPSockets, UDPSockets, server sockets and multicast controllers! An example telnet client (from GoogleLabs) <https://github.com/GoogleChromeLabs/telnet-client> gives a good explanation/sample code. I forked <https://github.com/p3anoman/jasmine-iwa> the Jasmine repo and made the basic modifications needed to run it as an IWA. I have gotten pretty good at that part ;) After cloning that repo and starting a web server to serve it, perform these steps: 1) In Chrome, navigate to chrome://flags 2) Search for "isolated", and enable the two flags. 3) Navigate to chrome://web-app-internals . 4) Enter the url for the server in the Dev Proxy input box and click Install . If it works, Chrome will create a desktop icon to run the IWA. All that's left to do is replace the WebSocket code with TCPSockets....in the SocketPlugin...totally foreign territory for me. The socket interfaces are dead simple. SocketPlugin code is not. I will give it a go but I am sure there are others on this list that could help? Note that there are some down sides to IWAs and while they are similar to PWAs they are quite different. They are not able to be reached from the "drive by" web, they are distributed as signed web bundles. They are meant to be installed thru enterprise channels". Otherwise, the web-app-internals install route is necessary. Running it in dev proxy mode will allow for saving changes to the Image - I *think*. I attempted to save a file-out last night. It dissappeared. A bundled installation would, I do believe, not be able to save image changes. I hope you find this useful. Cheers John -- chalculator.com Squeak-dev mailing list -- [email protected] To unsubscribe send an email to [email protected]