Skip to content

proxy always returns direct:// #260

@ameansone

Description

@ameansone

the problem is, if im not wrong, libproxy always return direct:// when network is unavailable, however, that api(g_network_monitor_get_network_available) to detect network always return false on my machine.

https://github.com/libproxy/libproxy/blob/42b58efd268bc0726dd4ec4e6a37d6ebb5e09cb5/src/backend/px-manager.c#L216C5-L216C5

verbose log

$ G_MESSAGES_DEBUG=all proxy http://google.com
(process:923185): GLib-GIO-DEBUG: 03:55:26.851: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
(process:923185): GLib-GIO-DEBUG: 03:55:26.866: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ?gio-vfs?
(process:923185): pxbackend-DEBUG: 03:55:26.868: px_config_sysconfig_set_config_file: Could not read file /etc/sysconfig/proxy
(process:923185): pxbackend-DEBUG: 03:55:26.869: Active config plugins:
(process:923185): pxbackend-DEBUG: 03:55:26.869:  - config-env
(process:923185): pxbackend-DEBUG: 03:55:26.869:  - config-kde
(process:923185): pxbackend-DEBUG: 03:55:26.869:  - config-gnome
(process:923185): pxbackend-DEBUG: 03:55:26.869:  - config-sysconfig
(process:923185): GLib-GIO-DEBUG: 03:55:26.874: _g_io_module_get_default: Found default implementation portal (GNetworkMonitorPortal) for ?gio-network-monitor?
(process:923185): pxbackend-DEBUG: 03:55:26.874: px_manager_on_network_changed: Network connection changed, clearing pac data
(process:923185): pxbackend-DEBUG: 03:55:26.874: px_manager_constructed: Up and running
(process:923185): pxbackend-DEBUG: 03:55:26.874: px_manager_get_proxies_sync: url=http://google.com online=0
direct://

i believe it's related to this issue.
https://gitlab.gnome.org/GNOME/glib/-/issues/1718

i copied some code from this issue to test.
https://gitlab.gnome.org/GNOME/glib/-/issues/3177
and it turns out that api never return true before the main loop.

im running latest manjaro kde, not sure if there's something misconfigured on my machine.

ps: i don't understand why it needs to check network first, for me, i would prefer it to be more consistent, maybe we can have some simple way to disable it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions