Initiate outgoing websocket

Howdy

I’d like to fetch some nosql data from a service from compute.

Making many http requests doesn’t sound very efficient or fast.
I found some evidence that wasmtime has socket support in development but afaik the only outgoing connections from fastly compute must be http/https via a backend
So it seems like an outgoing websocket would be a good solution.

However I’ve not found anything that suggests this is possible? All the websocket examples I’ve found handoff or pass and don’t actually handle any data themselves.

Any ideas?

Andy…

fyi, I’m using C/C++ and using fastly abi directly, so that I can do silly things like send a streaming body in a get request, not close it, and attempt to send more after the 101 Switching Protocols response.
so far, no joy.

Hey Andy – thinking through what your end goal is, it may be better to store the nosql data in the KV store then use it in your compute application locally. Obviously, that depends a lot on the nature of your data.

As for outgoing connections, you’re right that connecting over HTTP/S is only possible.

Generally speaking, I’d love to know more about what you’re building. Typically, when someone’s building directly against the ABI it’s a cool project :slight_smile:

Howdy aspires

Thanks for the suggestion,

It’s multiple gb of data. I might have to use kv store for just the most frequently fetched entries, or some sort of cache layer.
I’ve found kv store a little slower than expected, but probably faster than many http gets and using fastly/varnish cache.

Hopefully websocket support will come to Compute some time in the future?

Its a shop site, written in everyone’s favorite bloated memory hog of a programming language. Ironically, so far, experimenting with options for quickly fetched backend data for the site is more challenging than developing a proof of concept sdk for an unsupported language.
The differences between Viceroy and live are killing me right now.