redis / node-redis

Redis Node.js client
https://redis.js.org/
MIT License
16.91k stars 1.89k forks source link

Support for edge functions (Cloudflare's new connect() API) #2603

Open haris-codes opened 1 year ago

haris-codes commented 1 year ago

Motivation

Presently node-redis doesn't work with edge functions. I keep getting an error when trying to use it on Cloudflare Workers.

In response to another issue, @leibale had written -

Redis works over TCP, and "edge functions" do not support that.

One workaround is to make Redis work with HTTP, using one of these options:

Open an issue in the redis repository and hope it'll be implemented as a core feature.
Create/use a redis module to do it.
Create/use a proxy around redis to do it.

Another option is to wait for socket workers..

Recently, Cloudflare announced their new feature - connect() - that makes it possible to connect directly to any TCP-based service from Workers.

Could you please integrate this with node-redis so we can use it on Workers?

Thank, Haris

Basic Code Example

No response

arcinston commented 1 year ago

yes , was looking for the same thing

upstash has an http client but wanted something similar from redis-node would be great