laravel-dump-server icon indicating copy to clipboard operation
laravel-dump-server copied to clipboard

Customize host and port

Open nianwang opened this issue 6 years ago • 4 comments

Is it possible to customize the host and port and continuously pipe the output?

Currently, it appears the hostname/port is hard-coded to tcp://127.0.0.1:9912 via config/config.php.

A possible syntax similar to the following is recommended:

# following Laravel "php artisan serve" convention
php artisan dump-server --host="$HOST" --port="$PORT"

This way, we can avoid conflicts with other running services, especially those that allow automatically mapping host/port to local, user-friendly variants. For example, typicode/hotel.

nianwang avatar Sep 13 '18 20:09 nianwang

Especially since this is for debugging (local development), it looks like follow convention is to publish the config, which can then be overridden:

php artisan vendor:publish --tag=config

... then edit the resulting config/debug-server.php as needed. Perhaps a README.md update, then.

nianwang avatar Sep 14 '18 05:09 nianwang

@mpociot I go through the same issue with the cli What about https://github.com/laravel/framework/blob/e6c8aa0e39d8f91068ad1c299546536e9f25ef63/src/Illuminate/Foundation/Console/ServeCommand.php#L45-L54 ?

lucasmichot avatar Apr 04 '19 13:04 lucasmichot

Any word on this? It would be great to add a port.

twigs67 avatar Oct 23 '19 12:10 twigs67

It's now settable via .env

DUMP_SERVER_HOST=tcp://127.0.0.1:9912

BasvanH avatar Jul 10 '20 09:07 BasvanH