Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Can I transform HTTP to CoAP by the Proxy? #12

Open
GoogleCodeExporter opened this issue Nov 20, 2015 · 5 comments
Open

How Can I transform HTTP to CoAP by the Proxy? #12

GoogleCodeExporter opened this issue Nov 20, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. I run the coapClient and Proxy on different computer
2. set the setProxyUri  as ("http://ip:port") in theBasicCoapClient.java
3. run the wireshark,but the Proxy send a TCP package but not HTTP

What is the expected output? What do you see instead?
I want to transform HTTP to CoAP, I send a coap message to Proxy and it 
transform it to CoAP 

What version of the product are you using? On what operating system?
mac os x

Please provide any additional information below.
any document about the Proxy?

Original issue reported on code.google.com by [email protected] on 18 Oct 2012 at 7:47

@GoogleCodeExporter
Copy link
Author

[deleted comment]

1 similar comment
@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

It works with in the following scenarios:

From BasicCoapClient (COAP requests to HTTP resources):
   1) SERVER_ADDRESS set to the IP of the host running org.ws4d.coap.server.Proxy
   2) For coap-coap, use coapRequest.setProxyUri("coap:<ip_endpoint>/resource")
      - e.g ip_endpoint set to IP of host running BasicCoapServer
   3) For coap-http, use coapRequest.setProxyUri("http:<ip_endpoint>/resource")
      - N.B you need an HTTP server running at ip_endpoint

From Browser (HTTP requests to COAP resources):
   1) Setup a HTTP proxy using IP of the host running org.ws4d.coap.server.Proxy, port 8080
   2) Insert in the address bar the IP of the endpoint (e.g BasicCoapServer)

I deleted two useless comments. I hope this will help.

Original comment by [email protected] on 24 Mar 2015 at 11:18

@GoogleCodeExporter
Copy link
Author

I am still unsure how from the browser works.   I was going through the code 
and it looks like its just replacing the schema with coap;// and requesting a 
resource from it self.  How is the forwarding address passed? On Californium, 
its passed in the path like 
http://localhost:8080/proxy/coap://localhost:PORT/target

Original comment by [email protected] on 25 Mar 2015 at 5:22

@GoogleCodeExporter
Copy link
Author

If you setup the proxy as I said you can just do an http GET and you will get 
the translated CoAP resource (e.g http://127.0.0.1:5684/statistic is the one 
run by default in Proxy.java). No need for additional parameters

Original comment by [email protected] on 17 Apr 2015 at 1:37

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

No branches or pull requests

1 participant