We _are_ trying to help you.
First, learn english (this includes correct spelling - makes it a lot easier for people to understand what you're writing).
Then, you should probably spend some time learning to choose proper search keywords - as Thomas said, there's a LOT of information out there - and even sample source code.
Happy easter.
First, learn english (this includes correct spelling - makes it a lot easier for people to understand what you're writing).
Then, you should probably spend some time learning to choose proper search keywords - as Thomas said, there's a LOT of information out there - and even sample source code.
Happy easter.
I did, but found nowere code for comunivate with proxy.
The theror I know, as you can the in my code example.
But in praxis I need help. :cool:
Greet FF
The theror I know, as you can the in my code example.
But in praxis I need help. :cool:
Greet FF
I think you should follow Thomas advice,
in case you missed it:
:alright:
in case you missed it:
I recommend you to start programming something easier first and try again later when you have enough experience to write such a program.
:alright:
I know something about socket programmming.
Thats a good aim for the next.
But when I havn't any tuts about that or advice, I will learn that never.
Please help me a little more. From where you have learn that ?
Regard FF.:stupid:
P.S. Say me at least, whether its possible to send te mail with the HTTP-prot of the proxy sever.
:confused:
Thats a good aim for the next.
But when I havn't any tuts about that or advice, I will learn that never.
Please help me a little more. From where you have learn that ?
Regard FF.:stupid:
P.S. Say me at least, whether its possible to send te mail with the HTTP-prot of the proxy sever.
:confused:
P.S. Say me at least, whether its possible to send te mail with the HTTP-prot of the proxy sever.
:confused:
:confused:
Etherlord and EvilHomer2k have already explained this to you.
Thomas
I will read through my post agein :confused:
Bye !
Bye !
here a little change, but it doesn't work:
.data
proxyserver DB "192.168.0.1"
port DW 808
ultrastring DB 'Get http://****.de/index.html HTTP/1.0',0
.data?
sock dd ?
.code
INVOKE WSAStartup, 200h, ADDR wsadata
INVOKE socket, AF_INET, SOCK_STREAM, 0
.IF EAX != INVALID_SOCKET
INVOKE MessageBox, NULL, ADDR btempl, ADDR btempl, NULL
.ENDIF
MOV sock, EAX
MOV sin.sin_family, AF_INET
INVOKE htons, port
MOV sin.sin_port, ax
INVOKE inet_addr, ADDR proxyserver
LEA EAX, sin
INVOKE connect, sock, ADDR sin, sizeof sin
.IF EAX != SOCKET_ERROR
INVOKE MessageBox, NULL, NULL, NULL, NULL
INVOKE send, socket, ultrastring, 29, 0
.ENDIF
As you alredy know (for about 1 week) I want to kommunicate with my Proxy. But thise code doesnt work. Why ?
Did I make some hardcore-mistakes ?
Deep regards FF
.data
proxyserver DB "192.168.0.1"
port DW 808
ultrastring DB 'Get http://****.de/index.html HTTP/1.0',0
.data?
sock dd ?
.code
INVOKE WSAStartup, 200h, ADDR wsadata
INVOKE socket, AF_INET, SOCK_STREAM, 0
.IF EAX != INVALID_SOCKET
INVOKE MessageBox, NULL, ADDR btempl, ADDR btempl, NULL
.ENDIF
MOV sock, EAX
MOV sin.sin_family, AF_INET
INVOKE htons, port
MOV sin.sin_port, ax
INVOKE inet_addr, ADDR proxyserver
LEA EAX, sin
INVOKE connect, sock, ADDR sin, sizeof sin
.IF EAX != SOCKET_ERROR
INVOKE MessageBox, NULL, NULL, NULL, NULL
INVOKE send, socket, ultrastring, 29, 0
.ENDIF
As you alredy know (for about 1 week) I want to kommunicate with my Proxy. But thise code doesnt work. Why ?
Did I make some hardcore-mistakes ?
Deep regards FF
Besides what everybody else has told you ... to search and read yourself ... you need to tell us what is happening. We don't have access to your proxy, so we can't tell you anything when you say
You need to at least find why/where it isn't working then ask specific questions.
Also if you are going to communicate (looked how I spelled that compared to yours) with your proxy using HTTP, you need to read the HTTP RFC.
but it doesn't work
You need to at least find why/where it isn't working then ask specific questions.
Also if you are going to communicate (looked how I spelled that compared to yours) with your proxy using HTTP, you need to read the HTTP RFC.
Hi, your are totalty right ! - I forgot to say, whats wrong !
I cant connect.
If you want to try my Proxy the Adress is:
MittelalterStore.sytes.net
THX !
P.S. I have read the RFSs.
I hope that I articulated me right !
I cant connect.
If you want to try my Proxy the Adress is:
MittelalterStore.sytes.net
THX !
P.S. I have read the RFSs.
I hope that I articulated me right !
It is RFC not RFS
Also if you did read them, you have forgot how to end your send command. I am not going to tell you because I do not believe that you have read them. Hint there are two characters at the end of your string that are missing. That (of course) has nothing to do with you not being able to connect, but it will cause you problems later on.
I do not have a compiler/assembler on my computer where I am at. So I'll check that out later.
Also if you did read them, you have forgot how to end your send command. I am not going to tell you because I do not believe that you have read them. Hint there are two characters at the end of your string that are missing. That (of course) has nothing to do with you not being able to connect, but it will cause you problems later on.
I do not have a compiler/assembler on my computer where I am at. So I'll check that out later.
I meand RFCs sorry !
In my Programm I have 0 append at the proy's IP-string.
But it doesnt work.
the error occurs already at the socket cretion.
What now ? :confused:
In my Programm I have 0 append at the proy's IP-string.
But it doesnt work.
the error occurs already at the socket cretion.
What now ? :confused:
Some tips:
- The windows API usually uses null terminated strings but the HTTP protocol doesn't have 'strings' or something. It just has a sequence of bytes (plain text data for the request), without null terminators. So you don't need the 0 byte at the end as long as you give the right size as send's parameter (which is 46 for "GET http://MittelalterStore.sytes.net HTTP/1.0", not 29 like you wrote).
- Hardcoding a string's size is bad. Instead, define a constant for the length (preferably automatically calculated), or do add a 0 byte to the end and use lstrlen to determine the length of the string before sending it. Note that in the latter case, the 0 byte is *only* necessary for lstrlen, you are *not* actually sending it (just the characters). The former method saves a byte and a lstrlen call and is quite easy to use, my networking tutorial has an example of it (chapter 6).
- There's more to a HTTP request than just the GET line, you still need the headers (some of which are compulsary for most servers like host), and the request terminator (blank line)
- Read chapter 6 of my tutorial!. A nearly complete example of a HTTP request is explained in detail here.
- WSAStartup and send can fail too, don't forget error checking.
Thomas
- The windows API usually uses null terminated strings but the HTTP protocol doesn't have 'strings' or something. It just has a sequence of bytes (plain text data for the request), without null terminators. So you don't need the 0 byte at the end as long as you give the right size as send's parameter (which is 46 for "GET http://MittelalterStore.sytes.net HTTP/1.0", not 29 like you wrote).
- Hardcoding a string's size is bad. Instead, define a constant for the length (preferably automatically calculated), or do add a 0 byte to the end and use lstrlen to determine the length of the string before sending it. Note that in the latter case, the 0 byte is *only* necessary for lstrlen, you are *not* actually sending it (just the characters). The former method saves a byte and a lstrlen call and is quite easy to use, my networking tutorial has an example of it (chapter 6).
- There's more to a HTTP request than just the GET line, you still need the headers (some of which are compulsary for most servers like host), and the request terminator (blank line)
- Read chapter 6 of my tutorial!. A nearly complete example of a HTTP request is explained in detail here.
- WSAStartup and send can fail too, don't forget error checking.
Thomas
Thomas, what about the cr and lf?
What's a coincidence !
I just wantet do write, that it isnt't required to write these 0s.
I'm just reading you tutorial ! - Pretty cool ! *hihihi*
P.S. I have for every error an error handle !
I just wantet do write, that it isnt't required to write these 0s.
I'm just reading you tutorial ! - Pretty cool ! *hihihi*
P.S. I have for every error an error handle !
Thomas, what about the cr and lf?
Well forginforcer's request wasn't complete anyway so I left that out but my tutorial shows how to send a full request.
Originally posted by Forginforcer
What's a coincidence !
I just wantet do write, that it isnt't required to write these 0s.
What's a coincidence !
I just wantet do write, that it isnt't required to write these 0s.
Good you already know that :)
P.S. I have for every error an error handle !
Not in the code you posted so that's why I mentioned it.
Thomas
For a better overwiev purpose.
But in my full source I'm intercepting every error !
Thanks four your tip !
But in my full source I'm intercepting every error !
Thanks four your tip !
We _are_ trying to help you.
First, learn english (this includes correct spelling - makes it a lot easier for people to understand what you're writing).
well, not only that, but it will help understanding the documents and typing in search terms correctly (i can't remember who it was who did some furious searching, but spelled something incorrectly... always a problem for me, too - but that's why i like Google's 'did you mean' thing :grin: )
crlf = carriage return line field
cr = 13h
lf = 10h
cr = 13h
lf = 10h
INVOKE WSAStartup, 200h, ADDR wsadata
200h means version 0.2
200h means version 0.2
Geez, is thread for real? LOL