<small id='uXMDf'></small><noframes id='uXMDf'>

    • <bdo id='uXMDf'></bdo><ul id='uXMDf'></ul>
    <tfoot id='uXMDf'></tfoot>
      <i id='uXMDf'><tr id='uXMDf'><dt id='uXMDf'><q id='uXMDf'><span id='uXMDf'><b id='uXMDf'><form id='uXMDf'><ins id='uXMDf'></ins><ul id='uXMDf'></ul><sub id='uXMDf'></sub></form><legend id='uXMDf'></legend><bdo id='uXMDf'><pre id='uXMDf'><center id='uXMDf'></center></pre></bdo></b><th id='uXMDf'></th></span></q></dt></tr></i><div id='uXMDf'><tfoot id='uXMDf'></tfoot><dl id='uXMDf'><fieldset id='uXMDf'></fieldset></dl></div>

      <legend id='uXMDf'><style id='uXMDf'><dir id='uXMDf'><q id='uXMDf'></q></dir></style></legend>

      使用(客户端)javascript 直接连接到 Redis?

      时间:2023-10-04

        • <i id='icfG9'><tr id='icfG9'><dt id='icfG9'><q id='icfG9'><span id='icfG9'><b id='icfG9'><form id='icfG9'><ins id='icfG9'></ins><ul id='icfG9'></ul><sub id='icfG9'></sub></form><legend id='icfG9'></legend><bdo id='icfG9'><pre id='icfG9'><center id='icfG9'></center></pre></bdo></b><th id='icfG9'></th></span></q></dt></tr></i><div id='icfG9'><tfoot id='icfG9'></tfoot><dl id='icfG9'><fieldset id='icfG9'></fieldset></dl></div>
            <tbody id='icfG9'></tbody>
          <legend id='icfG9'><style id='icfG9'><dir id='icfG9'><q id='icfG9'></q></dir></style></legend>

          1. <tfoot id='icfG9'></tfoot>

            <small id='icfG9'></small><noframes id='icfG9'>

              <bdo id='icfG9'></bdo><ul id='icfG9'></ul>
              • 本文介绍了使用(客户端)javascript 直接连接到 Redis?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                有没有办法使用客户端(不是 Node.js)javascript 直接连接到 Redis?

                Is there a way to directly connect to Redis using client side (not Node.js) javascript?

                我已经成功地将 Node.js + PHP + Redis + Socket.io(用于客户端)用于一些项目.但是,我真的认为这可以进一步简化为 PHP + Redis + Browser javascript 之类的东西 - 去掉 Node.js 服务器,它只是另一个服务器,如果没有必要,我宁愿不使用它.对于简单的事情,我认为使用Javascript直接连接到Redis会更好.

                I'm already using Node.js + PHP + Redis + Socket.io (for the client) successfully for a few projects. However, I really think this could be further simplified to something like PHP + Redis + Browser javascript - taking out the Node.js server which is just another server I'd rather not use if it isn't necessary. For simple things, I think it would be better to just connect directly to Redis using Javascript.

                据我所知,Redis 只是通过一个端口来处理它的请求,因此任何可以向该端口发出请求的语言都可以工作.理论上,您不能使用客户端 javascript 访问 redis 服务器的端口吗?

                From what I understand, Redis just serves its request through a port so any language that can make requests to that port would work. In theory, couldn't you just hit the redis server's port using client side javascript?

                我最感兴趣的是发布/订阅功能,这可能也可能不可能.

                I'm mostly interested in the publish/subscribe functions, which may or may not be possible.

                我不确定您是否可以使用 AJAX 访问非 80 端口,但从技术上讲,您应该能够使用 Nginx 反向代理或其他方式将 Redis 的端口转发到 80 端口.

                I'm not sure if you can access a non-port 80 port using AJAX, but you technically should be able to forward Redis' port to port 80 using Nginx reverse proxy or something.

                有什么想法吗?只是一个想法.我对我目前的解决方案很满意,但不知道我们是否可以做得更好或更有效.

                Any ideas? Just a thought. I'm very happy with my current solution, but it doesn't hurt to wonder if we could do this even better or more efficiently.

                推荐答案

                您只能使用客户端 JavaScript 发出 HTTP 请求,在某些浏览器中,还可以使用 websocket.但是,您应该查看 Webdis.它为 Redis 添加了一个简单的 HTTP/JSON 层,应该完全符合您的要求.

                You can only make HTTP requests with client-side JavaScript and, in some browsers, websockets. However, you should look into Webdis. It adds an easy HTTP/JSON layer to Redis and should do exactly what you want.

                链接已修复.

                这篇关于使用(客户端)javascript 直接连接到 Redis?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:phpMyAdmin 相当于 MySQL for Redis 吗? 下一篇:Laravel 缓存与 Redis 非常慢

                相关文章

                最新文章

                1. <tfoot id='sHAKl'></tfoot>
                  <i id='sHAKl'><tr id='sHAKl'><dt id='sHAKl'><q id='sHAKl'><span id='sHAKl'><b id='sHAKl'><form id='sHAKl'><ins id='sHAKl'></ins><ul id='sHAKl'></ul><sub id='sHAKl'></sub></form><legend id='sHAKl'></legend><bdo id='sHAKl'><pre id='sHAKl'><center id='sHAKl'></center></pre></bdo></b><th id='sHAKl'></th></span></q></dt></tr></i><div id='sHAKl'><tfoot id='sHAKl'></tfoot><dl id='sHAKl'><fieldset id='sHAKl'></fieldset></dl></div>

                    • <bdo id='sHAKl'></bdo><ul id='sHAKl'></ul>
                  1. <legend id='sHAKl'><style id='sHAKl'><dir id='sHAKl'><q id='sHAKl'></q></dir></style></legend>

                    <small id='sHAKl'></small><noframes id='sHAKl'>