adding a proxy support to specific perl module - perl

I am using the following Perl module from CPAN Net::Whois::IANA which works well when there are no proxy but when a proxy is needed it fails .
from inspecting its code it using this module IO::Socket::INET to connect .
could someone provide how can I add proxy capability to this module ?

There is no such thing as a proxy for all protocols. A proxy is a protocol specific thing and there are different proxies needed for HTTP, SIP etc. As far as I know there is no such thing as a proxy defined for the whois protocol. What kind of proxy do you want to use with whois?

Related

PROXY protocol - test client /tool

Proxy Protocol is implemented by various software including of course HAProxy itself.
When testing from a host via a proxy, it would be useful to have a simple command-line tool to establish connections, controlling the various parameters.
I've looked at netcat, socat and other similar tools and it looks like it doesn't (yet) exist.
Does anyone know of a nice command-line testing tool?
As I couldn't find something, here's a start. Will add documentation etc. shortly.

Grpc C++ DNS overrides

I am trying to connect a grpc-c++ client to a grpc-c++ server. I already have a grpc-java client connected with working TLS so the server should be functioning correctly.
However inside grpc-java there is a method when building a channel named 'overrideAuthority'. From the documentation the method
"Overrides the authority used with TLS and HTTP virtual hosting. It does not change what host is actually connected to. Is commonly in the form host:port."
I was attempting to find something similar for the c++ client. However, so far all I have found is a function named set_authority() on the grpc::ClientContext as well as two options used with grpc_channel_args which are GRPC_ARG_DEFAULT_AUTHORITY and GRPC_SSL_TARGET_NAME_OVERRIDE_ARG.
None of these seem to have any effect on the authority at all. The server will always reject the connection with the error
No match found for server name: 0.0.0.0.
P.S. I am aware that I can add it to the common name on the certificate (and I will if I need to). However, if possible I would like to follow the same pattern as the grpc-java client.
GRPC_SSL_TARGET_NAME_OVERRIDE_ARG is the right channel arg. Please take a look at some of the tests https://github.com/grpc/grpc/blob/470a3066c74abc7c2a0a2cab3b35000b27b51af1/test/core/end2end/fixtures/h2_ssl.cc#L133
https://github.com/grpc/grpc/blob/470a3066c74abc7c2a0a2cab3b35000b27b51af1/test/cpp/end2end/xds/xds_end2end_test.cc#L1348
Additionally, if I remember correctly, this log just serves as a warning and does not result in disconnections. Please collect some more verbose logs https://github.com/grpc/grpc/blob/master/TROUBLESHOOTING.md. That might give more hints as to what's going on here.

Perl - DNS lookup using Socket and a specific DNS server

I use the Socket module to do DNS lookups with Perl. The Socket module uses whichever DNS server the system it runs on is using. Is there a way to force the Socket module use a different DNS server?
I know there are other modules such as "Net::DNS::Resolver", but I'd like to use core Perl modules for this.
Thank you
You could write your own DNS client or "shell out" to an external tool. Otherwise, there's no way to do DNS lookups with just core Perl[1], much less querying specific servers.
There are some functions that can end up doing DNS lookups some of the time as part of a larger name-resolution system (e.g. inet_aton).

how to let the kamailio support Edge Proxy?

As the RFC http://www.rfc-editor.org/rfc/rfc5626.txt describes , how can i extends a Edge Proxy by Kamailio ? should i write a module , or just write the configure file ?
have any one already do it ,could give me some advice .
thanks .
You could use an already configured instance - SipWise.
It's free, it's Kamailo based, it has an edge-proxy acting as a load-balancer at /etc/ngcp-config/templates/etc/kamailio/lb/kamailio.cfg.tt2, it's available as appliance and requires minimal configuration steps to run it with the basic features up.
You can use it directly, or you can just run it somewhere and take a look at the configuration.
Why write a module? Edge proxy is a pretty much a SIP proxy for REGISTERs.
You could accomplish that with just the configuration routes.

opendns and perl lwp::simple get

I am trying to filter web content that is accessed programmatically, lets say through lwp::simple or sockets.
I do not have any control over the server configuration, eg. dns settings
How will I be able to use opendns, with these restrictions.
is there per-request dns?
I am not that familiar with this topic, and I greatly appreciate your help.
LWP/Perl sockets use the operating system's resolver only. You need to set up a separate forwarder (e.g. dnsmasq) somewhere that can be configured to resolve certain hostname differently. Then either:
subclass LWP to use the external forwarder or
get permission to point the OS resolver there or
write something in C that hi-jacks the getnameinfo(3)/gethostbyaddr(3) and related system calls, then install this as preload hack.