Comments (6)
Yes, a proxy server is needed. I'm writing WebSockets support for Squeak on all host platforms, including SqueakJS. It supports transparent operation of the Flow networking API.
from squeakjs.
As of 94c003a we have a client-side only SocketPlugin using a public CORS proxy. It only supports http/https requests. So I think a WebSocket-based client+server solution is still needed, to enable non-http connections.
Do we want to ship two different SocketPlugins? Or merge them into one?
from squeakjs.
I think we should merge them into one. The networking support I mentioned is now part of another project that includes remote messaging, screen-sharing, and a new way of installing native Squeak. While those special cases have priority over transparent generalized socket use (similar to the image-updating case), I estimate having something separable in August.
from squeakjs.
I have updated the SocketPlugin with WebSocket support. It is working in my current setup (on NodeJS and within browser) with Cuis. Some more testing is needed with different images as well as some extra guards need to be build in. I do have a few questions though:
- Within original SocketPlugin the primitive methods sometimes do
popthenPush(argCount, ...)
and sometimespopthenPush
with some literal number. Shouldn't this always beargCount
? If not, what is the reason? See for exampleprimitiveSocketSendDataBufCount
whereargCount === 4
butpopthenPush(1, ...)
is performed. (This also happens in a few other plugins.) - What is the reason for using both
fetch(...)
andXMLHttpRequest
? It does not seem to be for supporting old browsers, sincefetch
seems similar in support asTextDecoder
andTextEncoder
which are used without a replacement. - I have also added name resolving in the SocketPlugin (using DNS over HTTPS). Would it be okay to receive this in a single PR or do you prefer separate PRs?
@ccrraaiigg maybe this is useful for Caffeine as well.
from squeakjs.
Awesome! I'm really busy atm, so can't review in detail, sorry. But as to your questions:
- Yes, we should use
argCount
consistently. If the primitive checks thatargCount
is the expected value then that is unnecessary, but it also doesn't cost much. fetch
vsXMLHttpRequest
is just historical I think. We started outXMLHttpRequest
but thenfetch
had some advantages, I think regarding CORS. It would be fine to get rid ofXMLHttpRequest
- single PR would be fine
from squeakjs.
I think this issue can be closed. If getting rid of XMLHttpRequest is relevant, maybe we should create separate issue for it. (Would clean things up in SocketPlugin ;-).
from squeakjs.
Related Issues (20)
- SoundPlayer has still room for improvement HOT 1
- TypeError: Cannot read property '3' of undefined
- Error on loading squeak.js -- line 29 HOT 2
- Very frequent "primitive 176 not implemented" in debugger running Cuis image HOT 3
- Error: Class not in class table HOT 5
- Custom pointer shapes not shown in Mac Safari HOT 3
- 64 bit Cuis image out of memory HOT 1
- Squeak 6.0 image format unknown HOT 2
- High-DPI not working HOT 9
- Primitive 218 doNamedPrimitiveWithArgs not implemented HOT 1
- Mouse fixed at top left in Firefox for Android HOT 3
- I succeeded in running squeakJS in the web browser. But, ... HOT 1
- I cant open my projects in scratch.js.org HOT 13
- Add file import button HOT 1
- Fix writing Scratch projects HOT 12
- Internet for Images? HOT 4
- File storage when added to Home Screen on iOS HOT 3
- Fix project saving HOT 3
- Fix user interrupt (cmd-.)
- Links dont work anymore HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from squeakjs.