Comments (4)
Sounds good to me. We can add a Hostname
type to the core library and implement the RFC validation. Maybe another type that represents an Either[Hostname, IpAddress]
with to/from string methods?
I'm on board with a submodule for cats and another for scalaz if there's interest. We could define Eq
/Order
/Show
instances then too.
from ip4s.
I was looking in to implementing this and ran in to a small issue. We can easily add a Hostname
type that checks RFC1123 compliance however, it is probably useful to also have a hostname type that supports internationalized domain names. RFC 3492 defines the conversion from an internationalized domain name to an RFC1123 domain name but that's a fairly large specification to implement. On the JVM, an implementation is provided by java.net.IDN but this class hasn't been ported to Scala.js.
Some options in increasing amount of work:
- don't support internationalized domain names
- only support internationalized domain names on the JVM
- link to an existing JS library for an RFC 3492 implementation on JS, link to
java.net.IDN
on JVM - build a pure Scala implementation of RFC 3492
from ip4s.
Could also add port IDN to scala-js (cleanroom Scala implementation) and then use that.
from ip4s.
Fixed via addition of Hostname
and IDN
types.
from ip4s.
Related Issues (20)
- Convert build to GitHub actions
- Improve CIDR validation for a given mask HOT 1
- Some class/method are not available with Scala.js HOT 2
- Enum for version of IP HOT 3
- mdoc dependency HOT 2
- Suggestion: CIDR could have a method that returns the number of IPs HOT 3
- apply returning Option? HOT 1
- Support for IPv4-mapped IPv6 addresses HOT 1
- Host.fromString parses a hostname with four or fewer characters into a Ipv6Address HOT 3
- Scala 3.0 should be used to publish Scala 3 artifacts HOT 4
- Need more lenient SourceSpecificMulticastJoin HOT 1
- Pure Scala IDNA implementation HOT 11
- Ciris Codecs HOT 4
- IDNTest flake HOT 6
- Support unix socket addresses, and possibly arbitrary other address types (?)
- Alternative version of Host.fromString that returns error message? HOT 2
- Cidr.fromString allows invalid CIDR ranges
- Cidr range are a bit messy HOT 1
- Feature Request: IsPrivate HOT 6
- IpAddress should implement scala.Ordered HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ip4s.