hushuitian / jcoap

Automatically exported from code.google.com/p/jcoap
0 stars 0 forks source link

How to use Proxy? #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I'd like to use Proxy in order to reach an isolated WSN from a remote station.

What steps will reproduce the problem?
1. My configuration is [ CoAP Client <---> Internet <---> jcoap Proxy - CoAP 
WSN ]
2. From the "proxy" station I run Proxy.class; also it's directly connected to 
the CoAP WSN.
3. From the "local station", in BasicCoapClient.java I set "fec0::2" (IPv6 of 
the CoAP Node) to SERVER_ADDRESS constant; in addition I've tried to set both 
of these properties:
coapRequest.setProxyUri("http://IP_Proxy:8080");
coapRequest.setProxyUri("coap://IP_Proxy:5683");
but, I've received a SocketException (Network is unreachable) because it tries 
to directly connect to fec0::2. 

What is the expected output? What do you see instead?
I expect to see a successful connection to my proxy, which can forward the CoAP 
Client request to the Node.

What version of the product are you using? On what operating system?
Latest version (by git). My OSs are both Ubuntu 11.10.

Please provide any additional information below.

Original issue reported on code.google.com by francesc...@gmail.com on 18 May 2012 at 4:02

GoogleCodeExporter commented 8 years ago
Ok, I solved it. I interpreted in a wrong way the options.

Now I set the SERVER_ADDRESS constant to the Proxy IP and the property 
"proxy-uri" in the following way: 
coapRequest.setProxyUri("coap://[fec0::2]:61616/sv").

It works!

Original comment by francesc...@gmail.com on 18 May 2012 at 9:53

GoogleCodeExporter commented 8 years ago
Thanks for your answer,but i still have some question.
1,Have you run the Proxy and BasicCoapServer on same computer?
2,what's the mean of: "also it's directly connected to the CoAP WSN"
How can it connected to the CoAP WSN?

Original comment by ly...@email.biigroup.com on 15 Oct 2012 at 4:09