Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

californium-proxy needs re-implementation #1

Open
mkovatsc opened this issue Jun 10, 2014 · 15 comments
Open

californium-proxy needs re-implementation #1

mkovatsc opened this issue Jun 10, 2014 · 15 comments
Labels

Comments

@mkovatsc
Copy link

The HTTP cross-proxy is currently broken.

  • Single-threaded handling prevents concurrent requests and losses of CoAP messages cause the proxy to freeze until the messages time out.
  • Caching does not work properly
  • Check correct handling of options when Proxy-Uri or Proxy-Scheme is set

HTTP needs to become an Endpoint implementation and requires integration into the Exchange concept.

@mkovatsc mkovatsc added the bug label Jun 10, 2014
@vvalchev
Copy link

vvalchev commented Jan 5, 2016

Hello Matthias,
is there a progress with that proxy?

I'm currently working on a solution:

  1. there is an LWM2M running in the cloud (but is limited to HTTP only)
  2. so there is dedicated docker instance running coap-to-http proxy
  3. the clients connect through the proxy to the LWM2M server

But I'm facing some problems:

  1. how to configure Eclipse Leshan to accept HTTP connections from the Proxy. In that case having the HTTP implemented as Endpoint would help.
  2. In the cloud, the Leshan server runs together with web server, that is used for some diagnostic purposes. However, if the Web Server takes port 80, then how I can bind the HTTP Endpoint to port 80 either? That is the only port accessible for the cloud!
    So I'm curious if it is possible the HTTP Endpoint to be implemented as Servlet?

WDYT, is above possible? Do you have any idea how?

@sophokles73
Copy link
Contributor

Hi @vvalchev,

I am not about Matthias' original intention behind his comment

HTTP needs to become an Endpoint implementation

I don't think it was meant to imply that Californium (and thus Leshan) should be able to speak CoAP over HTTP (which wouldn't make much sense from my point of view since CoAP is basically meant to be a UDP based, lightweight replacement for HTTP) but was instead meant to express his opinion regarding a better way of implementing the proxy component.

What you are trying to achieve would require changes in leshan, i.e. supporting HTTP instead of CoAP as the transport protocol for LWM2M. However, that is a question you should raise with the leshan project.

My understanding of your problem is that you are trying to run leshan in Cloud Foundry's elastic runtime but are limited to communicate with the outside world via HTTP on port 80 because of Cloud Foundry's router component that does not support UDP routing, correct? I do not think that translating between CoAP and HTTP hence and forth is the solution to that problem. UDP support is already in the back log for Cloud Foundry's go router, until then you should deploy leshan to another execution environment than th elastic runtime. You already mentioned Docker yourself which I consider a viable option.

@mkovatsc
Copy link
Author

mkovatsc commented Jan 9, 2016

I am also quite confused about the plan to proxy CoAP to HTTP and then extend Leshan with HTTP to connect devices... you can try this as personal work around, but this will never go into the project (+1 to what Kai said).

The plan for this issue is to rethink the HTTP integration once we tackle alternative transports. CoAP-over-TCP uses Netty, which we could also use for an HTTP endpoint that is attached to a translator.

@GiacomoGenovese
Copy link

Hi @vvalchev,
I would run Leshan on Cloud too,
Did you find a solution?

Thanks.

@vvalchev
Copy link

Hi @GiacomoGenovese,
Sorry, but I did't found solution for the problem. Actually stopped looking for it few months ago, since I've got a new job. Sorry.

Regards.
Valentin

@GiacomoGenovese
Copy link

Ok, Thanks.
Anyway, I found that Californium, the CoAP server used by Leshan, implements TCP connectors and, moreover, an other CoAP server, nCoAP, uses Netty.
I will keep searching in this direction.

Regards,
Giacomo.

sbernard31 pushed a commit to sbernard31/californium that referenced this issue Dec 23, 2016
sbernard31 pushed a commit to sbernard31/californium that referenced this issue Dec 23, 2016
…atching.

CoapEndpoint uses a MessageCallback for obtaining DTLS session
parameters from an underlying DTLS based Connector.
The Matcher then uses this information to check whether a Response with
a matching token has been received within the same DTLS session the
Request has been sent in.
@mdorfman
Copy link

mdorfman commented Mar 20, 2017

removed the question as not relevant for this thread
sorry :)

@GiacomoGenovese
Copy link

Please, consider that COAP and HTTP are both REST.
Honestly, I did not get the point.
Sorry

@sophokles73
Copy link
Contributor

This issue is not about general design questions around proxying hence and forth between CoAP and HTTP. Please use the mailing list for such questions.

@mdorfman
Copy link

mdorfman commented Mar 21, 2017 via email

@mdorfman
Copy link

mdorfman commented Mar 21, 2017 via email

@Gr3yh0und
Copy link

Is there a plan to implement DTLS into the proxy? I'm currently using the cf client to directly connect to my target via DTLS/PSK but I would rather use a normal HTTP REST client...

@mkovatsc
Copy link
Author

To get it to work, you can simply replace the CoAP connectors with Scandium DTLS connectors.
You have to decide for your application how to link the security contexts between HTTPS and CoAPS...

@lvlary6m-coap
Copy link

Hello
I have a problem too. I want to have a COAP lab. In fact, I run Californium and copper in Ubuntu Linux. I use a sample of COAP server and client and proxy. made them by maven and run them. I can see traffic with Wireshark but I want to see traffic with Burp suite so I try to use Postman. but the postman packet does not contain whole information for testing the COAP layer.
sample of Postman data is below.
GET /proxy/coap://localhost:5683/ HTTP/1.1
User-Agent: PostmanRuntime/7.26.1
Accept: /
Postman-Token: 381450c0-2e2d-4926-9cd3-5c486269037e
Host: localhost:8080
Accept-Encoding: gzip, deflate
Connection: close

How can I see all packet in burp suite?

@boaks
Copy link

boaks commented Jul 21, 2020

Please, this repository is not longer active!
Use Californium instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

8 participants