Command | Descrption | Parameters | Example |
---|---|---|---|
IPCFG | Display the current IP stack configuration | none | |
MAC | Set the last 3 bytes of the MAC address. Top 3 bytes will always be "00:80:10". This command also resets the whole IP stack, so new IP address will need to be assigned (via MYIP or DHCP) after calling MAC |
3 byte string | |
DHCP | Use DHCP to assign IP address, netmask, default gateway and DNS server | none | |
MYIP | Assign a new IP address | ||
NETMASK | Assign a new netmask | ||
GATEWAY | Assign a new default gateway (router to send non-local traffic to) | ||
DNS | Specify the DNS server to be used for resolving hostnames | ||
PING | Sends a number of ICMP echo requests to the specified host. For each packet sent, if a response is received a "." is displayed, if an error occurs (including a timeout) then a "!" is displayed. | ||
HTTPD | start listening on a TCP port for inbound HTTP requests. When a HTTP request is received, go to the specified default line number, unless the request happens to be for a path that has previously been HOOKed | ||
HOOK | sociate the 'path' part of a URL with a BASIC line number to jump to when a request for the specified path is received | ||
TYPE | change the HTTP Content Type field in the HTTP header from the default "text/html" to whatever is specified. Be careful with case - the remote end will be expecting ASCII not PETSCII! For this to be effective, it must be set BEFORE any data is output with the ! or XSEND keywords | ||
STATUS | change the HTTP status line from default "200 OK". Be careful you include the 3 digit code (as an ASCII string) then a space then a free form status description (ASCII NOT PETSCII). To be effective, it must be set BEFORE any data is output with the ! or XSEND keywords | ||
! | Send specified string expression. If no HTTP header has been sent yet, one will be sent now. | ||
XSEND | Send a file from the default drive. If the file does not exist, then an error message will be sent to the remote browser. If no HTTP header has been sent yet, one will be sent first. | ||
YIELD | finish processing the current request, go back and wait for another HTTP request. |
5 MAC CHR$(192)+CHR$(29)+CHR$(85) 10 DHCP 20 HOOK"/HELLO",1000 25 FA$="/"+CHR$(102)+CHR$(97)+CHR$(118)+CHR$(105)+CHR$(99)+CHR$(111) 27 FA$=FA$+CHR$(110)+CHR$(46)+CHR$(105)+CHR$(99)+CHR$(111) 30 HOOKFA$,2000 40 HTTPD80,100 100 !"<H1>HELLO</H1>" 110 !"<FORM ACTION=/HELLO>" 120 !"WHAT'S YOUR NAME?" 130 !"<INPUT TYPE=TEXT NAME=N>" 140 !"</FORM>" 200 YIELD 1000!"HELLO "+N$+", I'M A C64 RUNNING BASIC ON BAILS." 1010 FOR I=1 TO 10 1020 !"<BR>" 1030 !STR$(I) 1040 NEXT I 1100 YIELD 2000 TYPE"IMAGE/X-ICON" 2010 XSEND"FAVICON.ICO" 2020 YIELD