VirtualBox port forwarding not working with NAT adapter

Paravirtualized Network* (virtio-net) is the key select your vm that you want for port forwarding. NOTE: Make sure the vm is in stop mode. Select “Settings” Select “Network” Select any free Adapter. Lets say “Adapter 2” Enable “Enable Network Adapter” In Attached to dropdown, select “NAT” Select “Advanced” In Adapter Type: Select “Paravirtualized Network (virtio-net)” … Read more

adb forward remote port to local machine

Recently google updated ADB service. And added reverse command that should do the job. From reverse documentation: This implements the adb reverse feature, i.e. the ability to reverse socket connections from a device to the host. <forward-command> is one of the forwarding commands that are described above, as in: list-forward forward:<local>;<remote> forward:norebind:<local>;<remote> killforward-all killforward:<local> Note … Read more

Relaying a request in asp.net (Forwarding a request)

I have an extension method on HttpResponseBase to copy an incoming request to an outgoing request. Usage: var externalRequest = (HttpWebRequest)WebRequest.Create(“http://stackoverflow.com”); this.Request.CopyTo(externalRequest); var externalResponse = (HttpWebResponse)externalRequest.GetResponse(); Source: /// <summary> /// Copies all headers and content (except the URL) from an incoming to an outgoing /// request. /// </summary> /// <param name=”source”>The request to copy from</param> … Read more

Can I forward env variables over ssh?

You can, but it requires changing the server configuration. Read the entries for AcceptEnv in sshd_config(5) and SendEnv in ssh_config(5). update: You can also pass them on the command line: ssh foo@host “FOO=foo BAR=bar doz” Regarding security, note than anybody with access to the remote machine will be able to see the environment variables passed … Read more

How to use HTTP_X_FORWARDED_FOR properly?

You can use this function to get proper client IP: public function getClientIP(){ if (array_key_exists(‘HTTP_X_FORWARDED_FOR’, $_SERVER)){ return $_SERVER[“HTTP_X_FORWARDED_FOR”]; }else if (array_key_exists(‘REMOTE_ADDR’, $_SERVER)) { return $_SERVER[“REMOTE_ADDR”]; }else if (array_key_exists(‘HTTP_CLIENT_IP’, $_SERVER)) { return $_SERVER[“HTTP_CLIENT_IP”]; } return ”; }

tech