| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Fri, 16 Jan 2026 23:45:41 GMT
X-Served-By: cache-dfw-ktki8620045-DFW, cache-bom-vanm7210049-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768607141.773215,VS0,VE293
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
multiaddr: A network address format
[Skip to Readme]
multiaddr: A network address format
Multiaddr is a self-describing network address format supporting a variety of protocols, with both string and binary representations.
[Skip to Readme]
Downloads
- multiaddr-0.3.0.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1.0, 0.2.0, 0.3.0 |
|---|---|
| Dependencies | attoparsec (>=0.13.0.1 && <0.14), base (>=4.7 && <5), base58-bytestring (>=0.1.0 && <0.2.0), bytestring (>=0.10.6.0 && <0.11), cereal (>=0.5.1.0 && <0.6), errors (>=2.1.2 && <2.2), hashable (>=1.2.4.0 && <1.3), text (>=1.2.2.0 && <1.3) [details] |
| License | BSD-3-Clause |
| Copyright | (c) 2016 Micxjo Funkcio |
| Author | Micxjo Funkcio <micxjo@fastmail.com> |
| Maintainer | Micxjo Funkcio <micxjo@fastmail.com> |
| Uploaded | by MicxjoFunkcio at 2016-02-26T04:00:04Z |
| Category | Network |
| Home page | https://github.com/micxjo/hs-multiaddr |
| Source repo | head: git clone https://github.com/micxjo/hs-multiaddr |
| Distributions | |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Downloads | 1925 total (12 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2016-02-26 [all 1 reports] |
Readme for multiaddr-0.3.0
[back to package description]hs-multiaddr
A multiaddr implementation in Haskell. Multiaddr is a self-describing network address format supporting a variety of protocols, with both string and binary representations.
Installation
We're on Hackage, so just add multiaddr to your cabal build-depends.
Usage
import Network.Multiaddr
let Just somewhere = readMultiaddr "/ip4/8.8.8.8/tcp/80"
protocolNames somewhere -- ["ip4", "tcp"]
-- Encapsulation
-- Multiaddr is a monoid, `encapsulate` is just an alias for (<>)
let Just proxy = readMultiaddr "/ip6/::1/tcp/443"
let proxied = proxy `encapsulate` somewhere
toText proxied -- "/ip6/::1/tcp/443/ip4/8.8.8.8/tcp/80"
hasIPv6 proxied -- True
-- Grab an individual part of the address
parts proxied !! 2 -- "/ip4/8.8.8.8"
-- Encode into a ByteString
let bytes = encode proxied
-- Decode and get back the original!
let Just decoded = decode bytes
decoded == proxied -- True