This is a very simple HTTP server for Unix, using fork(). It's very easy to use
- include header
httpd.h
- write your route method, handling requests.
- call
serve_forever("12913")
to start serving on port 12913
<EditForm Model="@Item" OnValidSubmit="@(e => OnSave.InvokeAsync(Item))"> | |
<DataAnnotationsValidator /> | |
<ValidationSummary /> | |
<div class="form-group"> | |
<label for="Title">Name:</label> | |
<InputText id="Title" @bind-Value="Item.name" class="form-control" /> | |
</div> | |
<div class="form-group"> |
/***************************************************** | |
* This code was compiled and tested on Ubuntu 18.04.1 | |
* with kernel version 4.15.0 | |
*****************************************************/ | |
#include <linux/init.h> | |
#include <linux/module.h> | |
#include <linux/kernel.h> | |
#include <linux/netfilter.h> | |
#include <linux/netfilter_ipv4.h> |
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"net/http" | |
"sync" | |
"time" | |
) |
#!/usr/bin/env python3 | |
# Tcp Port Forwarding (Reverse Proxy) | |
# Author : WangYihang <[email protected]> | |
''' | |
+-----------------------------+ +---------------------------------------------+ +--------------------------------+ | |
| My Laptop (Alice) | | Intermediary Server (Bob) | | Internal Server (Carol) | | |
+-----------------------------+ +----------------------+----------------------+ +--------------------------------+ | |
| $ ssh -p 1022 [email protected] |<------->| IF 1: 1.2.3.4 | IF 2: 192.168.1.1 |<------->| IF 1: 192.168.1.2 | | |
| [email protected]'s password: | +----------------------+----------------------+ +--------------------------------+ |
# ref: https://play.golang.org/p/OeEmT_CXyO | |
package main | |
import ( | |
"fmt" | |
"runtime" | |
"strconv" | |
"strings" | |
"sync" | |
) |
package main | |
import ( | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" | |
"os" | |
"os/signal" |
/* | |
An example of using raw sockets. | |
You can capture packets by tcpdump: | |
tcpdump -X -s0 -i lo -p udp | |
*/ | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <stdio.h> |
/* | |
C socket server example, handles multiple clients using threads | |
Compile | |
gcc server.c -lpthread -o server | |
*/ | |
#include<stdio.h> | |
#include<string.h> //strlen | |
#include<stdlib.h> //strlen | |
#include<sys/socket.h> |
;----------------------------------------------; | |
; | |
; A minimal bootloader that prints a hello world | |
; then halts. | |
; | |
; nasm -f bin hello-boot.asm -o hello-boot.bin | |
; | |
; @YouriAckx | |
; | |
;----------------------------------------------; |