harwey/cups4j

getPrinters() returns no printers when I use 192.168.0.213 instead of 127.0.0.1

Closed this issue · 4 comments

cupsClient return no printers when I change no connection ip to 192.168.0.213 (the server address which has cups running).
After I change it to 127.0.0.1, it works great.
Also, I can get all printers when I open 192.168.0.213:631 from Chorme. What is the reason for it? Anyone can help>

[06/Oct/2022:16:17:32 -0700] [Client 21] Returning IPP successful-ok for CUPS-Get-Printers (http://192.168.0.213/printers) from 192.168.0.213.
4:22
D [06/Oct/2022:16:16:12 -0700] [Client 20] Returning IPP successful-ok for CUPS-Get-Printers (http://127.0.0.1/printers) from localhost.

The above logs are coming from cups logs. Is there any hit for this?

You can configure your CUPS server to listen on different interfaces. Please read the docs of your CUPS server.

@harwey @whatoeat2night
It just a error solution !!!
Finally i solved it by Nginx

this is my nginx config

server{
    listen 632;
    access_log /var/log/nginx/cups_access.log;
    error_log /var/log/nginx/cups_error.log;

    location / {
            proxy_pass  http://127.0.0.1:631/;
    }

}

I have try to listen new port 632 proxy to 127.0.0.1:631 its down
i dont know why? maybe cups web open in windows different from linux :) 💯