I hereby claim:
- I am cmol on github.
- I am cmol (https://keybase.io/cmol) on keybase.
- I have a public key whose fingerprint is 54C4 F886 5479 CCDB F367 DC13 720E 785B F86A EAD3
To claim this, I am signing this object:
""" | |
Script for requesting a port redirection via natPMP. | |
Follows the standart of: | |
http://tools.ietf.org/html/draft-cheshire-nat-pmp-07#section-3.3 | |
with the exception of hold times. We are not going to wait a little | |
above 3 minutes to test for natPMP. | |
""" | |
import socket | |
import random |
I hereby claim:
To claim this, I am signing this object:
2620:0000:0862:ed1a:0000:0000:0000:0001 |
message, client = server_socket.recvfrom(MSG_LENGTH) |
require "socket" | |
CONNECT_ADDR = "localhost" | |
CONNECT_PORT = 12345 | |
MSG_LENGTH = 256 | |
FLAGS = 0 | |
Addrinfo.udp(CONNECT_ADDR, CONNECT_PORT).connect do |socket| | |
socket.send("Connected via unspecified address family socket", FLAGS) | |
message, server = socket.recvfrom(MSG_LENGTH) |
require "socket" | |
LISTEN_ADDR = "::" | |
LISTEN_PORT = 12345 | |
MSG_LENGTH = 256 | |
FLAGS = 0 | |
# Create socket and bind it to the listen on all addresses and the given port | |
server_socket = UDPSocket.new :INET6 | |
server_socket.bind(LISTEN_ADDR, LISTEN_PORT) |
cmol@qui-gon:~$ ruby echo_client_udp.rb | |
[IPv6] Connected via unspecified address family socket |
cmol@qui-gon:~$ nc -4 -u localhost 12345 | |
Hello from IPv4! | |
[IPv4] Hello from IPv4! | |
cmol@qui-gon:~$ nc -6 -u localhost 12345 | |
Hello from IPv6! | |
[IPv6] Hello from IPv6! |
cmol@qui-gon:~$ ruby src/chat_server_udp.rb | |
Client connected from ::ffff:127.0.0.1 using IPv4 | |
Client connected from ::1 using IPv6 |
require "socket" | |
LISTEN_ADDR = "::" | |
LISTEN_PORT = 12345 | |
MSG_LENGTH = 256 | |
FLAGS = 0 | |
# Create socket and bind it to the listen on all addresses and the given port | |
server_socket = UDPSocket.new :INET6 | |
server_socket.bind(LISTEN_ADDR, LISTEN_PORT) |