A flag icon shows that page is written in: English, Ja Japanese

Socket and then HTTP

Configure Network Interfaces

Use Debian and edit /etc/network/interfaces like this:

auto eth0
iface eth0 inet static
  address 192.168.1.1
  network 192.168.1.1
  netmask 255.255.255.0
  broadcast 192.168.1.255

auto ppp0
iface ppp0 inet ppp
  provider dsl-provider
  up /usr/local/sbin/firewall.sh on
  down /usr/local/sbin/firewall.sh off

Edit /etc/ppp/peers/dsl-provider like this:

pty "pppoe -l eth0 -T 80 -m 1412"
user account@provider.ne.jp

Run these to bring up and shut down ppp0:

ifup ppp0
ifdown ppp0

iptables

Edit /etc/network/if-pre-up.d/iptables and configure filter and nat tables.

dhcpd

$ sudo aptitude install dhcp3-server

Edit /etc/dhcp3/dhcpd.conf and specify range of addresses for the subnet you use for DHCP automatic address assignment.

option domain-name "run.sh";
option domain-name-servers 192.168.1.1, 202.224.32.1, 202.224.32.2;

subnet 192.168.1.0 netmask 255.255.255.0 {
range 192.168.1.100 192.168.1.244;
option broadcast-address 192.168.1.255;
option routers 192.168.1.1;
}

$ sudo /etc/init.d/dhcp3-server restart

Java

Jakarta Commons HttpClient: Tutorial

HttpClient client = new HttpClient();
authget/authpost = new GetMethod(url) / PostMethod(url)
authpost.setRequestBody(NameValuePair[]);
excuteMethod(authpost)....

Programming a client and a server for httpchat will be a good practice.

Javascript

XMLHttpRequest

Emacs Lisp

UDP is most commonly used for DNS Lookups while its zones are transfered using TCP for the large quantity of transfers.

PHP

file_get_contents example

$fp = fsockopen(....);
fputs($fp, "hello");
$result = '';
while (!feof($fp)) { $result .= fgets($fp, 128); }
fclose($fp);

Perl

Helpful for creating CGI, text processing tools and background processes.

$ perldoc lwpcook

Accessing Bulletin Board Systems


Have fun.

Ryu ryu@run.sh