Skip to content

Instantly share code, notes, and snippets.

View codenoid's full-sized avatar

Rubi codenoid

View GitHub Profile
Changelog Development Documentation Download libcurl Mailing Lists News
cURL / Mailing Lists / curl-users / Single Mail
curl-users
FW: Specifying a IP address to curl
This message: [ Message body ] [ More options ]
Related messages: [ Next message ] [ Previous message ] [ Maybe in reply to ] [ Next in thread ] [ Replies ]
last week had me working on setting a squid proxy server with multiple IP/domains. the plan was to have squid route outgoing traffic to as many IPs that the server carries. the server only has one physical interface. the rest of the IPs are tied to it via aliases or a virtual interface. you can easily do this with the following command:
ifconfig ethX:Y <IP_ADDRESS>
where X is the number of your physical ethernet device, and Y is the number designated (arbitrary) for the virtual interface. you could also add the broadcast and netmask address in the same line as well. so it would look something like this:
ifconfig eth0:1 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0
for testing, a minimal configuration had the proxy running in no time. it would listen to 2 IPs for incoming HTTP requests on different ports. supposedly it should also route requests in the same IP where it was received. it didn’t. popular web services (ipchicken.com, whatismyip.com, whatismyip.org) for knowing your IP were used and
@codenoid
codenoid / server.cr
Created August 13, 2017 01:33 — forked from solisoft/server.cr
multi rooms kemal websockets server
require "kemal"
require "arangocr"
require "json"
connected_sockets = {} of String => Array(HTTP::WebSocket)
connected_users = {} of String => Hash(String, JSON::Any)
def broadcast(data, sockets)
sockets.each do |socket|
socket.send data.to_json
@codenoid
codenoid / basic.php
Created August 2, 2017 02:55
Super basic PHP Backend Dev
<?php
function db($do)
{
// DB Info
$servername = "localhost";
$username = "root";
$password = "ayam";
$dbname = "latihan_blog";
@codenoid
codenoid / .html
Created April 29, 2017 05:54
Simple Alarm App With Javascript
<!DOCTYPE html>
<html>
<head>
<title>JAM 2 BANGUNIN RUBI</title>
</head>
<body style="background-color: black;">
<center><br><br><br><br><br><br><br><br>
<h1 style="color: white;">JAM 2 PAGI BANGUNIN RUBI</h1>
<h3 style="color: white;">ALARM AKTIF PADA JAM 2 PAGI</h3>
<h4 style="color: white;" id="uh"></h4>