Giter VIP home page Giter VIP logo

Comments (4)

mpilquist avatar mpilquist commented on July 23, 2024

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.

mpilquist avatar mpilquist commented on July 23, 2024

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.

matthughes avatar matthughes commented on July 23, 2024

Could also add port IDN to scala-js (cleanroom Scala implementation) and then use that.

from ip4s.

mpilquist avatar mpilquist commented on July 23, 2024

Fixed via addition of Hostname and IDN types.

from ip4s.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.