<commit_before>import socket
from twisted.internet import reactor
from coapthon.proxy.forward_coap_protocol import ProxyCoAP

__author__ = 'giacomo'


class CoAPForwardProxy(ProxyCoAP):
    def __init__(self, host, port):
        ProxyCoAP.__init__(self)
        print "CoAP Forward Proxy start on " + host + ":" + str(port)


def main():
    portSocket = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
    # Make the port non-blocking and start it listening.
    portSocket.setblocking(False)
    portSocket.bind(('127.0.0.1', 9999))

    # Now pass the port file descriptor to the reactor
    port = reactor.adoptDatagramPort(
        portSocket.fileno(), socket.AF_INET6, CoAPForwardProxy("fdf8:f53e:61e4::18", 5683))

    # The portSocket should be cleaned up by the process that creates it.<commit_msg>ipv6 binding<commit_after>import socket
from twisted.internet import reactor
from coapthon.proxy.forward_coap_protocol import ProxyCoAP

__author__ = 'giacomo'


class CoAPForwardProxy(ProxyCoAP):
    def __init__(self, host, port):
        ProxyCoAP.__init__(self)
        print "CoAP Forward Proxy start on " + host + ":" + str(port)


def main():
    portSocket = socket.socket(socket.AF_INET6, socket.SOCK_DGRAM)
    # Make the port non-blocking and start it listening.
    portSocket.setblocking(False)
    portSocket.bind(('fdf8:f53e:61e4::18', 5683))

    # Now pass the port file descriptor to the reactor
    port = reactor.adoptDatagramPort(
        portSocket.fileno(), socket.AF_INET6, CoAPForwardProxy("fdf8:f53e:61e4::18", 5683))

    # The portSocket should be cleaned up by the process that creates it.
{'fraction_non_alphanumeric': 0.09766584766584767, 'fraction_numerical': 0.03132678132678133, 'mean_word_length': 4.074766355140187, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2441606', 'n_tokens_mistral': 567, 'n_tokens_neox': 518, 'n_words': 140}