Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<network> | |
<name>my-network</name> | |
<bridge name='my-bridge' stp='on' delay='0'/> | |
<ip address='10.100.0.1' netmask='255.255.255.0'/> | |
</network> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<network> | |
<name>test-network</name> | |
<forward mode='nat'> | |
<nat> | |
<port start='1024' end='65535'/> | |
</nat> | |
</forward> | |
<bridge name='virbr-test' stp='on' delay='0'/> | |
<ip address='192.168.200.1' netmask='255.255.255.0'> | |
<dhcp> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"log" | |
"net/http" | |
"os" | |
) | |
func build_handler(msg string) func(http.ResponseWriter, *http.Request) { | |
return func(writer http.ResponseWriter, request *http.Request) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create all namespaces | |
sudo ip netns add boxA | |
sudo ip netns add router | |
sudo ip netns add boxB | |
# Create veth pairs and move them into their respective namespaces | |
sudo ip link add veth0 type veth peer name veth1 | |
sudo ip link set veth0 netns boxA | |
sudo ip link set veth1 netns router | |
sudo ip link add veth2 type veth peer name veth3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from paste.deploy import loadapp | |
from wsgiref.simple_server import make_server | |
# | |
# A middleware that adds a key to the environment | |
# | |
class Middleware: | |
def __init__(self, app, key="test", value=1): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from paste.deploy import loadapp | |
from wsgiref.simple_server import make_server | |
# | |
# This is our application, as usual | |
# | |
def application(environ, start_response): | |
start_response( | |
'200 OK', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wsgiref.simple_server import make_server | |
class Middleware: | |
def __init__(self, app): | |
self.app = app | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wsgiref.simple_server import make_server | |
class Application: | |
def __init__(self, environ, start_response): | |
self.environ = environ | |
self.start_response = start_response | |
def __iter__(self): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wsgiref.simple_server import make_server | |
def application(environ, start_response): | |
start_response( | |
'200 OK', | |
[('Content-type', 'text/html')] | |
) | |
response = "<html><body><p><b>Environment data:</b></p>" |
NewerOlder