auth.php 401 B

1234567891011121314
  1. <?php
  2. Co::set(['hook_flags' => SWOOLE_HOOK_ALL ^ SWOOLE_HOOK_TCP]);
  3. go(function () {
  4. $redis = new Swoole\Coroutine\Redis;
  5. $ret = $redis->connect('host.docker.internal', 6379);
  6. // $redis->auth('root');
  7. // $redis->set('key', 'swoole redis work');
  8. // var_dump($redis->get('key'));
  9. $key = 'test_cache_data';
  10. $ret = wkcache($key, ["hello world"]);
  11. $data = rkcache($key);
  12. });