About Store Forum Documentation Contact



Post Reply 
Receive Http information
Author Message
samouraii Offline
Member

Post: #1
Receive Http information
Hello,

I'm trying to receive information for a web Server but, i can connect on the server, but i can't receive information. I'm starting with socket, can you help me? Thank you so mutch.

i'm try this:
Code:
newsSockAdd.setHost("google.be", 80);
   newsSock.createTcp(newsSockAdd);
  
   newsSock.bind(newsSockAdd);
   newsSock.block(false);
   Byte data[1024];
   int test = newsSock.receive(&data, 1024);

But i receive nothing.
thank you for your help
(This post was last modified: 03-22-2016 10:04 PM by samouraii.)
03-22-2016 04:49 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #2
RE: Receive Http information
Hi,

I recommend using 'Download' class for contacting the server.
HTTP is supported, but HTTPS not yet.
03-23-2016 10:16 AM
Find all posts by this user Quote this message in a reply
samouraii Offline
Member

Post: #3
RE: Receive Http information
Thank you for you reply, i'm trying
03-23-2016 11:45 PM
Find all posts by this user Quote this message in a reply
samouraii Offline
Member

Post: #4
RE: Receive Http information
Hello,

i trying to use 'Download', it's work, i receive information, but i don't receive all information.
This is my code:

Code:
bool InitUpdate()
{  
  download.create("http://qanga.alpha.iolacorp.com/news/game/");
}
bool Update()
{
    
     if( download.state() == DWNL_DONE)
   {
      File f2(download.data(),  download.size());
       messageNews = f2.getStr();
       Gui.msgBox(S, S+messageNews.length());
      download.del();
      
   }
   return true;
}

but when i trying this normaly i read this:" Coucou je suis une news du jeu je viens pour tester un truc mais j'en ai rien à faire" on HTTP server but when i read with this code i read juste "ouco"

when i try to change position with f2.pos(1)... I read the other part of the sentence.

Thank you for you reply
04-14-2016 01:12 PM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #5
RE: Receive Http information
You need to use FileText, File is for binary data
04-15-2016 12:53 AM
Find all posts by this user Quote this message in a reply
samouraii Offline
Member

Post: #6
RE: Receive Http information
Thank you, it's work
04-15-2016 08:01 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #7
RE: Receive Http information
Sorry for necroposting, but shall i wait for you to implement https for Download class soon? I just need that feature smile
08-06-2016 05:23 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #8
RE: Receive Http information
Hi,
Sorry, I don't know at the moment when this feature will become available.
08-06-2016 10:48 PM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #9
RE: Receive Http information
Now almost every site uses https, i hope you add that to a roadmap or open a contribution.
08-07-2016 05:22 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #10
RE: Receive Http information
Hi,

I think the cost would be around 500$ (there's a lot of technologies involved, and not much documentation).

Would anyone else be willing to contribute as well?
08-09-2016 12:16 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #11
RE: Receive Http information
Do i understand it right and you add https not only to Download class, but to socket and we will be able to use it in all connections?
08-09-2016 09:24 AM
Visit this user's website Find all posts by this user Quote this message in a reply
laugan Offline
Member

Post: #12
RE: Receive Http information
I'm in. Https support will be a useful addition. smile
08-09-2016 09:42 AM
Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #13
RE: Receive Http information
(08-09-2016 09:24 AM)Houge Wrote:  Do i understand it right and you add https not only to Download class, but to socket and we will be able to use it in all connections?
'Socket' is low level, and does not support anything other than raw binary send/receive.

If you're talking about 'Connection', then it already supports built-in encryption using 'Cipher1' class.

HTTPS will be added only to the 'Download' class.
08-09-2016 10:50 AM
Find all posts by this user Quote this message in a reply
Houge Offline
Member

Post: #14
RE: Receive Http information
There are not so many technologies involved smile
We need to use SSL connection for that which is provided by (all open-source, for example):
tlsMbed
OpenSSL
matrixSSL
boost.Asio

There are also examples of http-clients over ssl with downloading of content.
(This post was last modified: 08-21-2016 05:57 PM by Houge.)
08-21-2016 05:57 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Esenthel Online
Administrator

Post: #15
RE: Receive Http information
Hello,

I've did some research, and I'm against just blindly integrating OpenSSL, as I've read it is not well maintained (it was the cause of the Heartbleed problem).

Yes there are many technologies involved:
https://en.wikipedia.org/wiki/Transport_Layer_Security
There's plenty of hashes, ciphers, and key related software.

My idea is to analyze the most popular libraries, and based on that make a small lightweight integration of only the most popular (widely used) components.

I can open the contribution, but so far only 2 people mentioned they can contribute, which I think is not enough to reach the 500$ goal.

If more people will join in, I can open it up.

Thank you
08-21-2016 10:14 PM
Find all posts by this user Quote this message in a reply
Post Reply