简体   繁体   中英

How to get the same URL every time?

I recently found out about PHP Desktop and I want to use it for one of my future apps. However, something I need to make sure is that the URL is always the same when the program runs. Sometimes it's 127.0.0.1:56162, sometimes it's 127.0.0.1:62425 or some other random number at the end... how can I make sure the link always stays the same?

I figured out the answer:

  1. Open the settings.json file
  2. Replace the "0" on line 33 (listen_on) to a different port number. The dev recommends a port in the range of 49152–65535.

The "0" is the default value and will actually randomly pick a free port. If you want to have a specific port number every time, you'll have to hard code it there.

Relevant dev wiki page

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM