Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Allow port

Post Reply
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Allow port

Post by dilfich »

Hi!

Failed to load URL http://.........:4045 with error ERR_UNSAFE_PORT (-312).

MiniBrowser

Code: Select all

procedure CreateGlobalCEFApp;
begin
  GlobalCEFApp                     := TCefApplication.Create;
  GlobalCEFApp.cache               := 'cache';
  GlobalCEFApp.EnablePrintPreview  := True;
  GlobalCEFApp.EnableGPU           := True;
  GlobalCEFApp.LogFile             := 'debug.log';
  GlobalCEFApp.LogSeverity         := LOGSEVERITY_INFO;
  GlobalCEFApp.AddCustomCommandLine('--explicitly-allowed-ports=4045');
end;
Does not work, in a normal browser, if you specify through the shortcut works, what is wrong?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Allow port

Post by salvadordf »

Try replacing this line :

Code: Select all

GlobalCEFApp.AddCustomCommandLine('--explicitly-allowed-ports=4045');
with this line :

Code: Select all

GlobalCEFApp.AddCustomCommandLine('--explicitly-allowed-ports', '4045');
Navigate to "chrome://version" to see all the switches and compare the switches between the application with AddCustomCommandLine and the application that has a command line switch in the shortcut.
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: Allow port

Post by dilfich »

Thank you, yes it really works so well. :)
dilfich
Posts: 330
Joined: Thu Nov 30, 2017 1:17 am

Re: Allow port

Post by dilfich »

While this is not necessary, but the question arises, how to resolve any port? :?:
It is not very convenient to add each time, it is only necessary if there is a need for such a restriction yourself, but if it is not necessary, then it is not necessary.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Allow port

Post by salvadordf »

Chromium added this feature for security reasons :
https://superuser.com/questions/188058/which-ports-are-considered-unsafe-by-chrome
https://jazzy.id.au/2012/08/23/why_does_chrome_consider_some_ports_unsafe.html
https://chromium.googlesource.com/chromium/src.git/+/refs/heads/master/net/base/port_util.cc

Apparently, you can specify several ports separated by commas when you use that switch :
https://superuser.com/questions/188006/how-to-fix-err-unsafe-port-error-on-chrome-when-browsing-to-unsafe-ports
Post Reply