# Gofer.rs
[](https://unlicense.org)
[](https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html)
[](https://crates.io/crates/gofer)
[](https://docs.rs/gofer/)
**Gofer.rs** makes it easy to fetch and read files from URLs in Rust.
Just call `gofer::open(url)?` to get back a `Read`!
## ✨ Features
- Currently supports `https:`, `http:`, `file:`, and `data:` URLs.
- Supports opting out of any feature using comprehensive feature flags.
- Adheres to the Rust API Guidelines in its [naming conventions].
- 100% free and unencumbered public domain software.
## 🛠️ Prerequisites
- [Rust](https://rust-lang.org) 1.81+
## ⬇️ Installation
### Installation via Cargo
```bash
cargo add gofer
```
### Installation in `Cargo.toml` (with all features enabled)
```toml
[dependencies]
gofer = "0.1"
```
### Installation in `Cargo.toml` (with only specific features enabled)
```toml
[dependencies]
gofer = { version = "0.1", default-features = false, features = ["https"] }
```
## 👉 Examples
### Importing the library
```rust
use gofer::open;
```
### Reading HTTP(S) URLs
```rust
gofer::open("https://www.google.com/robots.txt")?
```
### Reading `file:` URLs
```rust
gofer::open("file://path/to/file.txt")?
```
### Reading `data:` URLs
```rust
gofer::open("data:,A%20brief%20note")?
```
## 📚 Reference
https://docs.rs/gofer/
## 👨💻 Development
```bash
git clone https://github.com/dryrust/gofer.rs.git
```
---
[](https://x.com/intent/post?url=https://github.com/dryrust/gofer.rs&text=Gofer.rs)
[](https://reddit.com/submit?url=https://github.com/dryrust/gofer.rs&title=Gofer.rs)
[](https://news.ycombinator.com/submitlink?u=https://github.com/dryrust/gofer.rs&t=Gofer.rs)
[](https://www.facebook.com/sharer/sharer.php?u=https://github.com/dryrust/gofer.rs)
[](https://www.linkedin.com/sharing/share-offsite/?url=https://github.com/dryrust/gofer.rs)
[naming conventions]: https://rust-lang.github.io/api-guidelines/naming.html