CoAP Client/Server implementing RFC 7252 for the Go Language

Related tags

canopus
Overview

Canopus

GoDoc Build Status Coverage Status Go Report Card

Canopus is a client/server implementation of the Constrained Application Protocol (CoAP)

Updates

25.11.2016

I've added basic dTLS Support based on [Julien Vermillard's][JVERMILLARD] [implementation][NATIVEDTLS]. Thanks Julien! It should now support PSK-based authentication. I've also gone ahead and refactored the APIs to make it that bit more Go idiomatic. [JVERMILLARD]: https://github.com/jvermillard [NATIVEDTLS]: https://github.com/jvermillard/nativedtls

Building and running

  1. git submodule update --init --recursive
  2. cd openssl
  3. ./config && make
  4. You should then be able to run the examples in the /examples folder

Simple Example

	// Server
	// See /examples/simple/server/main.go
	server := canopus.NewServer()

	server.Get("/hello", func(req canopus.Request) canopus.Response {
		msg := canopus.ContentMessage(req.GetMessage().GetMessageId(), canopus.MessageAcknowledgment)
		msg.SetStringPayload("Acknowledged: " + req.GetMessage().GetPayload().String())

		res := canopus.NewResponse(msg, nil)
		return res
	})

	server.ListenAndServe(":5683")

	// Client
	// See /examples/simple/client/main.go
	conn, err := canopus.Dial("localhost:5683")
	if err != nil {
		panic(err.Error())
	}

	req := canopus.NewRequest(canopus.MessageConfirmable, canopus.Get, canopus.GenerateMessageID()).(*canopus.CoapRequest)
	req.SetStringPayload("Hello, canopus")
	req.SetRequestURI("/hello")

	resp, err := conn.Send(req)
	if err != nil {
		panic(err.Error())
	}

	fmt.Println("Got Response:" + resp.GetMessage().GetPayload().String())

Observe / Notify

	// Server
	// See /examples/observe/server/main.go
	server := canopus.NewServer()
	server.Get("/watch/this", func(req canopus.Request) canopus.Response {
		msg := canopus.NewMessageOfType(canopus.MessageAcknowledgment, req.GetMessage().GetMessageId(), canopus.NewPlainTextPayload("Acknowledged"))
		res := canopus.NewResponse(msg, nil)

		return res
	})

	ticker := time.NewTicker(3 * time.Second)
	go func() {
		for {
			select {
			case <-ticker.C:
				changeVal := strconv.Itoa(rand.Int())
				fmt.Println("[SERVER << ] Change of value -->", changeVal)

				server.NotifyChange("/watch/this", changeVal, false)
			}
		}
	}()

	server.OnObserve(func(resource string, msg canopus.Message) {
		fmt.Println("[SERVER << ] Observe Requested for " + resource)
	})

	server.ListenAndServe(":5683")

	// Client
	// See /examples/observe/client/main.go
	conn, err := canopus.Dial("localhost:5683")

	tok, err := conn.ObserveResource("/watch/this")
	if err != nil {
		panic(err.Error())
	}

	obsChannel := make(chan canopus.ObserveMessage)
	done := make(chan bool)
	go conn.Observe(obsChannel)

	notifyCount := 0
	for {
		select {
		case obsMsg, _ := <-obsChannel:
			if notifyCount == 5 {
				fmt.Println("[CLIENT >> ] Canceling observe after 5 notifications..")
				go conn.CancelObserveResource("watch/this", tok)
				go conn.StopObserve(obsChannel)
				return
			} else {
				notifyCount++
				// msg := obsMsg.Msg\
				resource := obsMsg.GetResource()
				val := obsMsg.GetValue()

				fmt.Println("[CLIENT >> ] Got Change Notification for resource and value: ", notifyCount, resource, val)
			}
		}
	}

dTLS with PSK

	// Server
	// See /examples/dtls/simple-psk/server/main.go
	server := canopus.NewServer()

	server.Get("/hello", func(req canopus.Request) canopus.Response {
		msg := canopus.ContentMessage(req.GetMessage().GetMessageId(), canopus.MessageAcknowledgment)
		msg.SetStringPayload("Acknowledged: " + req.GetMessage().GetPayload().String())
		res := canopus.NewResponse(msg, nil)

		return res
	})

	server.HandlePSK(func(id string) []byte {
		return []byte("secretPSK")
	})

	server.ListenAndServeDTLS(":5684")

	// Client
	// See /examples/dtls/simple-psk/client/main.go
	conn, err := canopus.DialDTLS("localhost:5684", "canopus", "secretPSK")
	if err != nil {
		panic(err.Error())
	}

	req := canopus.NewRequest(canopus.MessageConfirmable, canopus.Get, canopus.GenerateMessageID())
	req.SetStringPayload("Hello, canopus")
	req.SetRequestURI("/hello")

	resp, err := conn.Send(req)
	if err != nil {
		panic(err.Error())
	}

	fmt.Println("Got Response:" + resp.GetMessage().GetPayload().String())

CoAP-CoAP Proxy

	// Server
	// See /examples/proxy/coap/server/main.go
	server := canopus.NewServer()

	server.Get("/proxycall", func(req canopus.Request) canopus.Response {
		msg := canopus.ContentMessage(req.GetMessage().GetMessageId(), canopus.MessageAcknowledgment)
		msg.SetStringPayload("Data from :5685 -- " + req.GetMessage().GetPayload().String())
		res := canopus.NewResponse(msg, nil)

		return res
	})
	server.ListenAndServe(":5685")

	// Proxy Server
	// See /examples/proxy/coap/proxy/main.go
	server := canopus.NewServer()
	server.ProxyOverCoap(true)

	server.Get("/proxycall", func(req canopus.Request) canopus.Response {
		canopus.PrintMessage(req.GetMessage())
		msg := canopus.ContentMessage(req.GetMessage().GetMessageId(), canopus.MessageAcknowledgment)
		msg.SetStringPayload("Acknowledged: " + req.GetMessage().GetPayload().String())
		res := canopus.NewResponse(msg, nil)

		return res
	})
	server.ListenAndServe(":5683")

	// Client
	// See /examples/proxy/coap/client/main.go
	conn, err := canopus.Dial("localhost:5683")
	if err != nil {
		panic(err.Error())
	}

	req := canopus.NewRequest(canopus.MessageConfirmable, canopus.Get, canopus.GenerateMessageID())
	req.SetProxyURI("coap://localhost:5685/proxycall")

	resp, err := conn.Send(req)
	if err != nil {
		println("err", err)
	}
	canopus.PrintMessage(resp.GetMessage())

CoAP-HTTP Proxy

	// Server
	// See /examples/proxy/http/server/main.go
	server := canopus.NewServer()
	server.ProxyOverHttp(true)

	server.ListenAndServe(":5683")

	// Client
	// See /examples/proxy/http/client/main.go
	conn, err := canopus.Dial("localhost:5683")
	if err != nil {
		panic(err.Error())
	}

	req := canopus.NewRequest(canopus.MessageConfirmable, canopus.Get, canopus.GenerateMessageID())
	req.SetProxyURI("https://httpbin.org/get")

	resp, err := conn.Send(req)
	if err != nil {
		println("err", err)
	}
	canopus.PrintMessage(resp.GetMessage())
Issues
  • dTLS Support with PSK

    dTLS Support with PSK

    feature 
    opened by zubairhamed 10
  • Token is not set on response

    Token is not set on response

    The output has been modified and does not match currently checked-in code. For example, token is printed using "% x" format.

    Received bytes: 44 01 1a bf 78 6d f2 d7 bb 2e 77 65 6c 6c 2d 6b 6e 6f 77 6e 04 63 6f 72 65 10

    2015/09/23 10:27:23 = = = = = = = = = = = = = = = = 2015/09/23 10:27:23 Code: 1, 1 2015/09/23 10:27:23 Code String: GET 2015/09/23 10:27:23 MessageId: 6847, 1abf 2015/09/23 10:27:23 MessageType: 0, 0 2015/09/23 10:27:23 Token: 78 6d f2 d7 2015/09/23 10:27:23 Token Length: 4 2015/09/23 10:27:23 Payload str: 2015/09/23 10:27:23 Payload hex: 2015/09/23 10:27:23 - - - OPTIONS - - - 2015/09/23 10:27:23 Code/Number: 11 , Name: Uri-Path , Value: .well-known 2015/09/23 10:27:23 Code/Number: 11 , Name: Uri-Path , Value: core 2015/09/23 10:27:23 Code/Number: 12 , Name: Content-Format , Value: 2015/09/23 10:27:23 = = = = = = = = = = = = = = = =

    Library generates response and it is clear that Token is not included. I believe that according to spec section "5.3.2 Request/Response Matching Rules" response token must match request token.

    2015/09/23 10:27:23 = = = = = = = = = = = = = = = = 2015/09/23 10:27:23 Code: 69, 45 2015/09/23 10:27:23 Code String: 205 Content 2015/09/23 10:27:23 MessageId: 6847, 1abf 2015/09/23 10:27:23 MessageType: 2, 2 2015/09/23 10:27:23 Token: 2015/09/23 10:27:23 Token Length: 0 2015/09/23 10:27:23 Payload str: <//hello>,<//hello>,<//basic>,<//basic/json>,<//basic/xml>,<//.well-known/core>, 2015/09/23 10:27:23 Payload hex: 3c 2f 2f 68 65 6c 6c 6f 3e 2c 3c 2f 2f 68 65 6c 6c 6f 3e 2c 3c 2f 2f 62 61 73 69 63 3e 2c 3c 2f 2f 62 61 73 69 63 2f 6a 73 6f 6e 3e 2c 3c 2f 2f 62 61 73 69 63 2f 78 6d 6c 3e 2c 3c 2f 2f 2e 77 65 6c 6c 2d 6b 6e 6f 77 6e 2f 63 6f 72 65 3e 2c 2015/09/23 10:27:23 - - - OPTIONS - - - 2015/09/23 10:27:23 Code/Number: 12 , Name: Content-Format , Value: 40 2015/09/23 10:27:23 = = = = = = = = = = = = = = = = 2015/09/23 10:27:23 Response bytes: 60 45 1a bf c1 28 ff 3c 2f 2f 68 65 6c 6c 6f 3e 2c 3c 2f 2f 68 65 6c 6c 6f 3e 2c 3c 2f 2f 62 61 73 69 63 3e 2c 3c 2f 2f 62 61 73 69 63 2f 6a 73 6f 6e 3e 2c 3c 2f 2f 62 61 73 69 63 2f 78 6d 6c 3e 2c 3c 2f 2f 2e 77 65 6c 6c 2d 6b 6e 6f 77 6e 2f 63 6f 72 65 3e 2c

    opened by kulak 3
  • error looping infinite

    error looping infinite

    i wrote a tiny project as https://github.com/crazydiamondzgy/iot-coap-client-c-sdk, and I test with californium server which is right.

    when I test with canopus simple server, like this

    func main() { server := NewLocalServer()

    server.Post("/v1/appid/1", func(req CoapRequest) CoapResponse {
        log.Println("Hello Called")
        PrintMessage(req.GetMessage())
        msg := ContentMessage(req.GetMessage().MessageId, TYPE_ACKNOWLEDGEMENT)
        msg.SetStringPayload("Acknowledged: " + req.GetMessage().Payload.String())
        res := NewResponse(msg, nil)
    
        return res
    })
    
    server.Start()
    

    }

    the first time, everything is ok, I closed my tool and reopen to test the second time canopus display error looping infinite as below:

    2015/09/18 01:00:47 read udp 0.0.0.0:5683: i/o timeout 2015/09/18 01:00:47 This was a *net.OpError with a Timeout 2015/09/18 01:00:47 read udp 0.0.0.0:5683: i/o timeout 2015/09/18 01:00:47 This was a *net.OpError with a Timeout 2015/09/18 01:00:47 read udp 0.0.0.0:5683: i/o timeout 2015/09/18 01:00:47 This was a *net.OpError with a Timeout 2015/09/18 01:00:47 read udp 0.0.0.0:5683: i/o timeout 2015/09/18 01:00:47 This was a *net.OpError with a Timeout 2015/09/18 01:00:47 read udp 0.0.0.0:5683: i/o timeout 2015/09/18 01:00:47 This was a *net.OpError with a Timeout

    by the way, I change some code like this to display error code

        readBuf := make([]byte, BUF_SIZE)
    for {
        len, addr, err := conn.ReadFromUDP(readBuf)
        if err == nil {
    
            msgBuf := make([]byte, len)
            copy(msgBuf, readBuf)
    
    
            go s.handleMessage(msgBuf, conn, addr)
        } else {
                    switch err := err.(type) {
    
                    case net.Error:
                        if err.Timeout() {
                        log.Println("This was a *net.OpError with a Timeout")
                        }
                    }
    
                    if err != nil {
                        log.Println(err.Error())
                    }
              }
    }
    
    opened by crazydiamondzgy 3
  • support block-wise transfers

    support block-wise transfers

    opened by zubairhamed 2
  • CoAP Proxy

    CoAP Proxy

    • unsafe options in response not recognized by coap coap, respond 5.02
    • cross check allowed coap accept headers allowed - returns 406 not acceptable
    opened by zubairhamed 2
  • Observe Notify example not working

    Observe Notify example not working

    The client OnNotify method is never called

    opened by mkwatson 2
  • Add ProxyFilter fn which allows filtering incoming clients

    Add ProxyFilter fn which allows filtering incoming clients

    server.SetProxyFilter(func(*Message, *net.UDPAddr) (bool) {
        ...
        return true
    })
    
    opened by zubairhamed 1
  • HTTP-CoAP proxy

    HTTP-CoAP proxy

    • Expose HTTP Proxy Endpoint at root /
    • if Request starts with coap/coaps
    • if not enabled/proxy not allowed, return 5.01
    • if timeout, return 5.04
    • if response not understood, return 5.02
    • cross check allowed coap accept headers allowed - returns 406 not acceptable
    • Methods
      • OPTIONS return 5.01
      • TRACEw return 5.01
      • GET if Success return 2.00 response payload == CoAP Representation resource, Content-Type and Content-Encoding header must be set
        • Include to CoAP Request
          • Accept, Conditional GET
          • If Accept, validate Accept is valid, else return 4.06
      • HEAD
        • Like GET but no message body response
      • POST
        • If the action performed by the POST method does not result in a resource that can be identified by a URI, a 200 (OK) or 204 (No Content) response MUST be returned to the client.
        • If a resource has been created on the origin server, a 201 (Created) response MUST be returned.
        • If CoAP responds with Location-, return to HTTP the Location- Headers
      • PUT, DELETE
      • CONNECT return 5.01
    feature 
    opened by zubairhamed 1
  • Issue connecting LWM2M client

    Issue connecting LWM2M client

    I wasn't able to run your LWM2M client example from the betwixt project - the client would connect sucessfully to a LWM2M server, but even the registration message did not get send out successfully.

    I traced this down to an issue in canopus:

    • serveServer() in server.go starts listening to a local socket
    • run_basic_client.go then triggers sending out a registration message via Send()
    • Send() starts listening to another local socket and sends the registration message to the server from there
    • server then responds back to the socket opened by Send(), not the one by serveServer()

    Actually, the LWM2M client should only ever need to listen to one socket. In this branch, I implemented a change where Send() reuses the already opened UDP socket, instead of opening another one: https://github.com/crenz/canopus/commit/6dc7ba1671f3e23c6af4ad05986b5a0a94a77dcc

    Registration now suceeds, and requests are received successfully from Leshan and Wakaama LWM2M servers.

    opened by crenz 1
  • calculate blockPayloadStart wrong when send blocks

    calculate blockPayloadStart wrong when send blocks

    if blockSize = 2, blockPayloadStart should be 0, 2, 4, 6 ... but your formulation: blockPayloadStart = currSeq*uint32(blockSize) + (currSeq * 1) will generate 0, 3, 6 ...

    opened by zltl 1
  • Malicious CoAP Messages Causes Server Crashes

    Malicious CoAP Messages Causes Server Crashes

    Hi,

    similarly to bsmelo, I have tried my hands on fuzzy testing CoAP applications for my master's thesis. I used the "simple" example server as a target and managed to produce two different types of fatal errors that caused server crashes.

    These errors were likely caught by bsmelo, and I suspect they have not been fixed as his issue remains open. Please contact me at [email protected] and I will provide you with the server error logs that specifies the location of each error.

    Regards Fredrik

    opened by fliljeda 0
  • does coapServer support query_string-like uri?

    does coapServer support query_string-like uri?

    according to the function: "CreateNewRegExRoute()", it seems like i cannot use uri such like server.Get("/query/string/{mac}?arg1={val} actually, i put info into msgPayload, but it's not standard REST usage that GET method contains payload, it's possible to support that?

    opened by AllenKd 0
  • src/github.com/zubairhamed/canopus/openssl/include/openssl/e_os2.h:13:11: fatal error: openssl/opensslconf.h: No such file or directory

    src/github.com/zubairhamed/canopus/openssl/include/openssl/e_os2.h:13:11: fatal error: openssl/opensslconf.h: No such file or directory

    Hello all,

    i am trying to use canopus but i got the following error:

    # github.com/zubairhamed/canopus In file included from src/github.com/zubairhamed/canopus/openssl/include/openssl/err.h:13, from src/github.com/zubairhamed/canopus/dtls.go:9: src/github.com/zubairhamed/canopus/openssl/include/openssl/e_os2.h:13:11: fatal error: openssl/opensslconf.h: No such file or directory # include <openssl/opensslconf.h> ^~~~~~~~~~~~~~~~~~~~~~~ compilation terminated. make: *** [Makefile:20: deps] Error 2

    on my project i am using this makefile to consume the library:

    export GOPATH := $(PWD)
    export GOBIN := $(GOPATH)/bin
    export PATH := $(PATH):$(GOBIN)
    export CGO_ENABLED := 1
    
    export PRG := edge-node-simulator
    
    all: bin src pkg build
    
    bin:
    	mkdir bin
    
    src: 
    	mkdir src
    
    pkg:
    	mkdir pkg
    
    deps:
    	go get -v github.com/zubairhamed/canopus
    
    build: deps
    	go install src/main/$(PRG).go
    
    .PHONY: build
    
    clean:
    	rm -rf bin
    	rm -rf pkg
    	rm -rf src/github.com
    
    run:
    	go run src/main/$(PRG).go
    
    

    any guidance on how do i get canopus working?

    many thanks in advance

    opened by sombriks 1
  • Not able to run psk client example

    Not able to run psk client example

    I have successfully managed to run the psk server example, but when running the client I get an error in the SSL_connect function in openssl. My environment:

    • gcc version 6.4.0
    • go version go1.10.3 linux/amd64

    I set up the repo according to the readme, and also set LD_LIBRARY_PATH=./openssl before running the examples.

    The complete stacktrace is presented here:

    fatal error: unexpected signal during runtime execution
    [signal SIGSEGV: segmentation violation code=0x1 addr=0xe0 pc=0x7fbebe1e612b]
    
    runtime stack:
    runtime.throw(0x6ca5d8, 0x2a)
    	/usr/local/go/src/runtime/panic.go:616 +0x81
    runtime.sigpanic()
    	/usr/local/go/src/runtime/signal_unix.go:372 +0x28e
    
    goroutine 1 [syscall]:
    runtime.cgocall(0x62b8f0, 0xc42005dc78, 0xe)
    	/usr/local/go/src/runtime/cgocall.go:128 +0x64 fp=0xc42005dc48 sp=0xc42005dc10 pc=0x404d04
    github.com/zubairhamed/canopus._Cfunc_SSL_connect(0xd8bea0, 0x0)
    	_cgo_gotypes.go:379 +0x49 fp=0xc42005dc78 sp=0xc42005dc48 pc=0x620439
    github.com/zubairhamed/canopus.(*DTLSConnection).connect.func1(0xd8bea0, 0xb)
    	/home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:763 +0x56 fp=0xc42005dcb0 sp=0xc42005dc78 pc=0x628116
    github.com/zubairhamed/canopus.(*DTLSConnection).connect(0xc420090550, 0x10, 0xc42013e150)
    	/home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:763 +0x2f fp=0xc42005dce0 sp=0xc42005dcb0 pc=0x624acf
    github.com/zubairhamed/canopus.(*DTLSConnection).Write(0xc420090550, 0xc42013e170, 0x21, 0x40, 0x40, 0x0, 0x0)
    	/home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:708 +0xea fp=0xc42005dd30 sp=0xc42005dce0 pc=0x6247ba
    github.com/zubairhamed/canopus.(*DTLSConnection).sendMessage(0xc420090550, 0x6f6100, 0xc4200905a0, 0x0, 0x687c80, 0x0, 0x0)
    	/home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:674 +0x27d fp=0xc42005ddf0 sp=0xc42005dd30 pc=0x62426d
    github.com/zubairhamed/canopus.(*DTLSConnection).Send(0xc420090550, 0x6f5b40, 0xc420027230, 0x7, 0x6c053f, 0x9, 0x6f5400)
    	/home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/dtls.go:653 +0x4d4 fp=0xc42005dec8 sp=0xc42005ddf0 pc=0x623e84
    main.main()
    	/home/franz/PROGRAMMERING/GO/src/github.com/zubairhamed/canopus/examples/dtls/simple-psk/client.go:19 +0x128 fp=0xc42005df88 sp=0xc42005dec8 pc=0x62ad98
    runtime.main()
    	/usr/local/go/src/runtime/proc.go:198 +0x212 fp=0xc42005dfe0 sp=0xc42005df88 pc=0x42dc32
    runtime.goexit()
    	/usr/local/go/src/runtime/asm_amd64.s:2361 +0x1 fp=0xc42005dfe8 sp=0xc42005dfe0 pc=0x457a01
    exit status 2
    
    opened by franzwilhelm 4
  • [Potential] Security Vulnerabilities within canopus

    [Potential] Security Vulnerabilities within canopus

    Hello developers of canopus,

    My name is Bruno, and I'm an MSc. student in Brazil within the Institute of Computing from the University of Campinas. As part of my research on the application of fuzzing techniques for robustness and security black-box testing of CoAP implementations, I've tested your library. The sample used in my research was compiled from distribution/commit e374f5b @ 2018-02-07. The application used to test it was examples/server/server.go.

    I'm contacting you because the application mentioned above was one of the samples for which our tool was able to detect robustness and/or security issues. In a broad sense, every failure we found can actually be classified as a security vulnerability, because they impact availability --- the application either aborts or needs forceful restart in order to restore servicing CoAP requests. However, we didn't go as far as performing a thorough root-cause analysis for those failures, since it would be unfeasible for us (more than 100 failures were detected across 25 samples, each one using a different CoAP library, spanning 8 programming languages) and thus out-of-scope of this particular research.

    We think that one of our main contributions is the opportunity to make a real-world impact on IoT security by reporting those failures to CoAP libraries' maintainers, with a comprehensible and easy way to replicate them so developers can further investigate and fix those failures. So, in order to follow up with a responsible disclosure process, we ask for a proper e-mail address (or any other form of contact) so we can send you:

    • A script to reproduce the failures;
    • A pcap file used by the script, containing the packets causing the failures;
    • A logfile with the stacktraces we got for each reported failure.

    We expect a reply anytime soon. Please let us know if which form of contact should we use --- or if it's ok to use this channel.

    Thanks & Regards, Bruno Melo.

    opened by bsmelo 1
  • DTLS only supports a single request

    DTLS only supports a single request

    Only the first request is responded to.

    I've been trying to trace it through the differences between server.handleIncomingDTLSData and server.handleIncomingData

    but without luck

    opened by ptone 2
  • add CBOR media type

    add CBOR media type

    opened by ptone 0
  • Can't run examples

    Can't run examples

    Hello,

    First of all, I'm very new to go, so maybe that is my actual problem... But I can't get the examples to run. The closer I got was by following the steps below:

     $ export GOPATH=/home/bruno/Dropbox/coap-apps/go
     $ cd /home/bruno/Dropbox/coap-apps/go/src/
     $ git clone https://github.com/zubairhamed/canopus zubairhamed/canopus
     $ ls
    dustin  ibm-security-innovation  zubairhamed
     $ cd zubairhamed/canopus
     $ git submodule update --init --recursive
     $ cd openssl
     $ ./config && make
     $ /usr/lib/go-1.10/bin/go run examples/simple/server.go
    # github.com/zubairhamed/canopus
    In file included from _cgo_export.c:3:0:
    ./dtls.go: In function ‘init_session_bio_method’:
    ./dtls.go:63:43: warning: passing argument 2 of ‘BIO_meth_set_write’ from incompatible pointer type
      BIO_meth_set_write(go_session_bio_method,write_wrapper);
    (...)
    cgo-gcc-prolog: In function ‘_cgo_81a35f110302_Cfunc_DTLSv1_2_server_method’:
    cgo-gcc-prolog:195:2: warning: ‘DTLSv1_2_server_method’ is deprecated (declared at ./openssl/include/openssl/ssl.h:1642) [-Wdeprecated-declarations]
    cgo-gcc-prolog: At top level:
    cc1: warning: unrecognized command line option "-Wno-incompatible-pointer-types"
    /tmp/go-build995684464/b001/exe/server: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory
    exit status 127
    

    So I've tried the following, but still with no success:

     $ export LD_LIBRARY_PATH=./openssl/                                                 
     $ /usr/lib/go-1.10/bin/go get github.com/zubairhamed/canopus
    # github.com/zubairhamed/canopus
    In file included from _cgo_export.c:3:0:
    ./dtls.go: In function ‘init_session_bio_method’:
    ./dtls.go:63:43: warning: passing argument 2 of ‘BIO_meth_set_write’ from incompatible pointer type
      BIO_meth_set_write(go_session_bio_method,write_wrapper);
    (...)
    cgo-gcc-prolog: In function ‘_cgo_81a35f110302_Cfunc_DTLSv1_2_server_method’:
    cgo-gcc-prolog:195:2: warning: ‘DTLSv1_2_server_method’ is deprecated (declared at ./openssl/include/openssl/ssl.h:1642) [-Wdeprecated-declarations]
    cgo-gcc-prolog: At top level:
    cc1: warning: unrecognized command line option "-Wno-incompatible-pointer-types"
    

    What should I do? By the way, I don't even want to run the DTLS-enabled examples, just the plain CoAP ones will do...

    Thanks! Bruno Melo.

    opened by bsmelo 2
  • server.NotifyChange for binary data

    server.NotifyChange for binary data

    Hi!

    Is there anyway to send binary data for server.NotifyChange or the observe notify system? If not, what would be needed to make that functionality available? Best, Jordan

    opened by jordanhart 0
  • Optimal client implementation for time series collecting?

    Optimal client implementation for time series collecting?

    An InfluxData Telegraf contributor expressed an interest in adding a CoAP observer plugin: https://github.com/influxdata/telegraf/issues/2994

    Could you point out some important points which need to be considered to make sure that the plugin is suitable for thousands of devices, also from the configuration perspective?

    Here is an MQTT consumer plugin as a reference: https://github.com/influxdata/telegraf/tree/master/plugins/inputs/mqtt_consumer

    opened by amq 0
Owner
Zubair Hamed
Code Monkey, Hardware Junkie
Zubair Hamed
V3IO Frames ("Frames") is a Golang based remote data frames access (over gRPC or HTTP stream)

V3IO Frames ("Frames") is a multi-model open-source data-access library that provides a unified high-performance DataFrame API for working with different types of data sources (backends). The library was developed by Iguazio to simplify working with data in the Iguazio Data Science Platform ("the platform"), but it can be extended to support additional backend types.

null 22 Jul 12, 2021
An experimental go FTP server framework

graval Go FTP server framework. By providing a simple driver class that responds to a handful of methods you can have a complete FTP server. Some samp

Koofr 27 Jul 17, 2021
Fast RFC 5389 STUN implementation in go

STUN Package stun implements Session Traversal Utilities for NAT (STUN) [RFC5389] protocol and client with no external dependencies and zero allocatio

null 467 Jul 17, 2021
Fast RFC 5389 STUN implementation in go

STUN Package stun implements Session Traversal Utilities for NAT (STUN) [RFC5389] protocol and client with no external dependencies and zero allocatio

null 467 Jul 17, 2021
Hprose 1.0 for Golang (Deprecated). Hprose 2.0 for Golang is here:

Hprose for Golang Introduction Installation Usage Http Server Http Client Synchronous Invoking Synchronous Exception Handling Asynchronous Invoking As

Hprose 138 Jun 28, 2021
Privacy important, fast, recursive dns resolver server with dnssec support

?? Privacy important, fast, recursive dns resolver server with dnssec support Installation go get github.com/semihalev/sdns Pre-build Binaries Downloa

Yasar Alev 673 Jul 23, 2021
A LWM2M Client and Server implementation (For Go/Golang)

Betwixt - A LWM2M Client and Server in Go Betwixt is a Lightweight M2M implementation written in Go OMA Lightweight M2M is a protocol from the Open Mo

Zubair Hamed 50 Jun 29, 2021
Diameter stack and Base Protocol (RFC 6733) for the Go programming language

Diameter Base Protocol Package go-diameter is an implementation of the Diameter Base Protocol RFC 6733 and a stack for the Go programming language. St

Alexandre Fiori 175 May 31, 2021
Access more HTTP ports over CDN with this application.

More-Ports More Ports is a proxy service to establish all web-based applications on different ports on the server-side over a well known TCP port. It

Ahmet ÖZER 3 May 16, 2021
webrpc is a schema-driven approach to writing backend services for modern Web apps and networks

webrpc is a schema-driven approach to writing backend servers for the Web. Write your server's api interface in a schema format of RIDL or JSON, and t

null 378 Jul 16, 2021
Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH.

Chisel is a fast TCP/UDP tunnel, transported over HTTP, secured via SSH. Single executable including both client and server. Written in Go (golang). Chisel is mainly useful for passing through firewalls, though it can also be used to provide a secure endpoint into your network.

Jaime Pillora 6.1k Jul 23, 2021
A tiny command line DNS client with support for UDP, DoT, DoH, and DoQ.

q A tiny command line DNS client with support for UDP, DoT, DoH, and DoQ. Usage q command line DNS client (https://github.com/natesales/q) Usage: q

Nate Sales 41 Jul 14, 2021
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.

frp README | 中文文档 What is frp? frp is a fast reverse proxy to help you expose a local server behind a NAT or firewall to the Internet. As of now, it s

null 47k Jul 22, 2021