Jump to content
View in the app

A better way to browse. Learn more.

The Uniform Server Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

EdHost - allow longer, valid top level domains

Featured Replies

Hi

First great that this is getting developed again - and that the source is now public :)

One problem I always had is that I use Uniform Server for local development - and as such always wanted to use the .test and .localhost top level domains for development as they are reserved to prevent conflict (https://en.wikipedia.org/wiki/.localhost). However EdHost.exe limits the top level domain to 2 or 3 letters (e.g. com, uk).

I had a quick look at the code and in the source in lazuras IDE, and in the uniform_common_functions.pas there are two functions - valid_server_name, valid_server_name2 - that both have regex's that cause the limit. For example at line 176 in the function valid_server_name2 we have:

 

  //-- Check domain name looks resonable e.g fred.com
  If valid_input then
   begin
      If server_name = 'localhost' Then valid_input := True
      Else
        begin
         If Not ExecRegExpr('^[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(/\S*)?$', server_name) Then
            valid_input := False;
        end;
   end;

I did a test and by modifying this to allow longer strings {2,9} I can now successfully create .test and .localhost. The official specs allow a max of 63 characters so this really should be {2,63} - https://stackoverflow.com/questions/9238640/how-long-can-a-tld-possibly-be/9239264

I am no Pascal developer but I used lazarus 1.8.4 to build this and it now works exactly as I want.  (I had to add  LazFileUtils as an extra item to line 20 of us_common_procedures.pas to prevent an error, but maybe that isn't needed in the version 1.2.2 it was originally built in?)

Can  you update the Uniform release with an updated version of EdHost.exe?

That would leave my only other current issue that it cannot automatically create the vhost entry using https... but I think someone has already requested that :)

Thanks again

 

  • 1 month later...

Older versions of US didn't need a compiler like lazarus (good to see some popular software is still made in object pascal!).

Instead php scripts were executed via a batch file - and IMO this is still the better way of doing it rather than a gui which is possibly limited to certain OS's and may require runtimes etc.

  • 3 years later...
On 1/10/2020 at 9:25 AM, xymox12 said:

Hi

First great that this is getting developed again - and that the source is now public :)

One problem I always had is that I use Uniform Server for local development - and as such always wanted to use the .test and .localhost top level domains for development as they are reserved to prevent conflict (https://en.wikipedia.org/wiki/.localhost). However EdHost.exe limits the top level domain to 2 or 3 letters (e.g. com, uk).
 

Should have mentioned thius in my previous reply years ago lol..

An easier way would be to use the domain extension of .lan - No need to recompile anything in lazarus, just use .lan. 

It indicates it's local on your network and meets the 3 characters. I've been doing it for years.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.