michaelrsweet / lprint

A Label Printer Application
https://www.msweet.org/lprint
Apache License 2.0
219 stars 29 forks source link

Setting server-name doesn't appear to work #70

Closed SmittyHalibut closed 1 year ago

SmittyHalibut commented 1 year ago

When I start a server as:

sudo /snap/bin/lprint server -o log-level=debug -o server-name=lprint.halibut.com

It still tries to use the autodetected hostname of pan.local and won't accept connections to lprint.halibut.com

D [2022-07-27T19:27:08.034Z] Registering DNS-SD name 'LPrint' on 'pan.local'

and

I [2022-07-27T19:27:46.631Z] [Client 1] POST http://lprint.halibut.com:8000/ipp/print/LabelPrinter HTTP/1.1
E [2022-07-27T19:27:46.631Z] [Client 1] Bad Host: header 'lprint.halibut.com'.
I [2022-07-27T19:27:46.631Z] [Client 1] Bad Request

Full debug console output: 2022-07-27-server-name-not-working.txt

Am I doing something wrong? Or is this actually a bug?

michaelrsweet commented 1 year ago

Use -o server-hostname=NAME - the server-name option sets the human-readable name.