californium.core icon indicating copy to clipboard operation
californium.core copied to clipboard

californium-proxy needs re-implementation

Open mkovatsc opened this issue 11 years ago • 15 comments

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 avatar Jun 10 '14 12:06 mkovatsc

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?

vvalchev avatar Jan 05 '16 16:01 vvalchev

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.

sophokles73 avatar Jan 06 '16 09:01 sophokles73

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.

mkovatsc avatar Jan 09 '16 16:01 mkovatsc

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

Thanks.

GiacomoGenovese avatar Oct 13 '16 15:10 GiacomoGenovese

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

vvalchev avatar Oct 15 '16 11:10 vvalchev

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.

GiacomoGenovese avatar Oct 17 '16 08:10 GiacomoGenovese

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

mdorfman avatar Mar 20 '17 11:03 mdorfman

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

GiacomoGenovese avatar Mar 21 '17 10:03 GiacomoGenovese

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.

sophokles73 avatar Mar 21 '17 13:03 sophokles73

sure

From: Kai Hudalla [mailto:[email protected]] Sent: Tuesday, March 21, 2017 3:33 PM To: eclipse/californium.core [email protected] Cc: DORFMAN, Masha [email protected]; Comment [email protected] Subject: Re: [eclipse/californium.core] californium-proxy needs re-implementation (#1)

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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_eclipse_californium.core_issues_1-23issuecomment-2D288079085&d=DwMCaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=_lOdJbmetoL5N2_zJRnO8K8YuSSaremI-qyaK45hUyU&m=ULpD1Log7eUv6BWuU49mZ-p0RbbvylHkzSoUsWxK82g&s=440-zqxeVVBLEHnA2WlYVW-r4nsFbNqzLurfXB_RHx0&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AXJS4SuNoxhAtkOW4Vi60fsTyz-5Fn3O-5FAks5rn9GigaJpZM4CCyIl&d=DwMCaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=_lOdJbmetoL5N2_zJRnO8K8YuSSaremI-qyaK45hUyU&m=ULpD1Log7eUv6BWuU49mZ-p0RbbvylHkzSoUsWxK82g&s=rk8sSQCheiWjNHWyb38Vp7AwUgg8ex2TIgyLr5qNX2c&e=.

mdorfman avatar Mar 21 '17 14:03 mdorfman

My question probably is far more simple. I’m quite sure I miss something very basic. I can create client with uri [coap://….}. But I can’t create it with [http://…} That’s all ☺ I’ll resolve it Thank you for the response

MD

From: Giacomo Genovese [mailto:[email protected]] Sent: Tuesday, March 21, 2017 12:36 PM To: eclipse/californium.core [email protected] Cc: DORFMAN, Masha [email protected]; Comment [email protected] Subject: Re: [eclipse/californium.core] californium-proxy needs re-implementation (#1)

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

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_eclipse_californium.core_issues_1-23issuecomment-2D288038331&d=DwMCaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=_lOdJbmetoL5N2_zJRnO8K8YuSSaremI-qyaK45hUyU&m=XyC5TH-rHIS-QhV6bNrnTLhqsYL2_dUWAO9QQCxxC5o&s=b_3yrwKTPEJDMhaPYRd4Pg12T2wOIY5KhsiHkXk8bdo&e=, or mute the threadhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AXJS4a-5FPliVyEEjDkqUTijdcpyG4Q7d6ks5rn6gbgaJpZM4CCyIl&d=DwMCaQ&c=LFYZ-o9_HUMeMTSQicvjIg&r=_lOdJbmetoL5N2_zJRnO8K8YuSSaremI-qyaK45hUyU&m=XyC5TH-rHIS-QhV6bNrnTLhqsYL2_dUWAO9QQCxxC5o&s=qFNPQ-nhz4SCtz4cyZ9zjGJrAkiEAaGh2epRiJgQvWc&e=.

mdorfman avatar Mar 21 '17 14:03 mdorfman

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...

Gr3yh0und avatar Apr 03 '17 21:04 Gr3yh0und

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...

mkovatsc avatar Apr 27 '17 13:04 mkovatsc

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?

lvlary6m-coap avatar Jul 21 '20 09:07 lvlary6m-coap

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

boaks avatar Jul 21 '20 09:07 boaks