Skip to content

Commit e94b465

Browse files
committed
Mention :url option in README
Closes #391.
1 parent e33c565 commit e94b465

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,19 @@ listening on `localhost`, port 6379. If you need to connect to a remote
3838
server or a different port, try:
3939

4040
```ruby
41-
redis = Redis.new(:host => "10.0.1.1", :port => 6380)
41+
redis = Redis.new(:host => "10.0.1.1", :port => 6380, :db => 15)
4242
```
4343

44+
You can also specify connection options as an URL:
45+
46+
```ruby
47+
redis = Redis.new(:url => "redis://:[email protected]:6380/15")
48+
```
49+
50+
By default, the client will try to read the `REDIS_URL` environment variable
51+
and use that as URL to connect to. The above statement is therefore equivalent
52+
to setting this environment variable and calling `Redis.new` without arguments.
53+
4454
To connect to Redis listening on a Unix socket, try:
4555

4656
```ruby

0 commit comments

Comments
 (0)