How Can You Request A Webpage Using Winsock And HTTPS?
HTTP is easy to form requests with using winsock.. but how can you make requests to a https site?
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Send Request To Webpage
I ONLY want to request the page, NOT recieve it. The purpose of this is for the sever to process a PHP and create the HTML, but i don't care about whats in the html, so i dont want to waste the time downloading it. I am using Microsoft Internet Transfer Control 6.0 to get the page. I don't know if i can stick with this, or if i need to use someting else. This is the code to RECIEVE the page:
VB Code:
txtCode.Text = INET.OpenURL(txtURL.Text)
Any ideas?
Request A Variable From VB And Show It On Webpage
Hello Everyone,
How do a webpage capture a variable from a VB program?
For example,
I,m using ASP for my webpage.
There is a variable in a VB program that i need to capture, and show the value at my website..
I need to know which component to use?
THanks in a million...........
Regards,
Lawrence
Send Post Request To A Webpage
What's the "fastest" way to send a HTTP POST request to a webpage?
I know the winsock method. But I believe it is kinda slow.
Winsock And HTTPS
So my first question. I downloaded some code using the winsock api and it looks like theres a tag in it to flag SSL/HTTPS protocol. Am I incorrect with this and why isn't that flag in the winsock control?
My main question is I'm trying to put together the HTTPS header and I'm not having any luck it keeps dropping the connection imeeadiatly and I'm assuming its because I don't have the header formatted properly.
Is there any examples of a valid https request and header someone can point me to?
I'm currently trying to follow the rfc and its a little confusing.
HTTPS And Winsock
Is there any way to make a POST work over https via winsock?
I can do it very easily if Im just using standard HTTP
but I can't do it using HTTPS and the winsock control.
I mean i set it up to use port 443 and everything but I just get 403 errors.
SSL / Https With Winsock- Know How?
How do I download a web page at an https:// address with Winsock? I have the winsock control in my app and I try the sending GET + the URL. But the server says I'm using the wrong command. I also tried an ActiveX (PowerTCP) to do this, but I need something asynchronous (it's not), so I can have multiple connections at once.
Winsock With HTTPS
How do u use winsock with https? At the moment, my application works with HTTP.
Many thanks to all.
Edited by - Esupofo on 10/17/2002 9:55:40 AM
Accessing HTTPS With Winsock.
I know it's possible, but I cannot seem to work it out. I know that I need to grab the site's security certificate and use that to decrypt the webpage, but I have not found anyone who knows how to to do this.
Anyone?
HTTPS Proxy In WinSock Control?
Hi
Is there a way to use a https proxy with the MS winsock control? I have been searching these forums for about 2 days and cannot find anything about it..
Any help is appreciated!!
Also, is there a alternative to the WinSock control with new features/functions in it?
Thanks
Connecting To Https (secure) Sites With Winsock, Possible Or Not?
I'm just starting out with the winsock control and I'm wondering
how I can connect to secure sites. Now when I connect to sites
I just use :
winsock1.connect "www.mysite.net", 80
and specifying http or https in front of the URL does not work.
So will it be difficult for me to connect to secure sites, log in and
retrive data using the winsock control or is it not possible?
If not, what other ways are there to connect to a secure site, log in and retrieve data, without using the rather bulky webbrowser control?
Maybe through API?
Winsock Syntax? (To Request A Website With The Winsock Control)
Ok, I don't know very much about Winsock and am just now starting to use it. I'm making an anonymity program that modifies referer and user agent data. I managed to find an example of how its done on planetsourcecode.com but there's a few things that aren't working.
Anyway, when this string is sent, it sends the headers and a request for index.html from the connected host (winsock1.connect domain.com 80).
GET index.html HTTP/1.0
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-comet, */*
Accept-Language: en
Accept-Encoding: gzip , deflate
Cache-Control: no-cache
Proxy-Connection: Keep-Alive
User-Agent: Whatever
Referer: www.whatever.com
But when I used the website http://ipid.shat.net/ as the domain to see if code mdified the headers or not, it directed me instead to just www.shat.net. How would a browser request information to ipid.shat.net?
Also, I noticed that by sending just that information, cookies don't work properly. What other tags do I have to add onto that for it to recieve my session information? Thanks a lot.
HTTPS : Need To Send A Text File To A Server Using HTTPS In VB 6.0 Application
Hi !
I have a VB 6.0 application in which I need to put a text file on the server using HTTPS protocol only.
I downloaded Catalyst File Transfer Control. I am able to get files through the control but cannot put files on server though my program runs without errors.
Any other means by which HTTPS can be used to transfer a text file from a VB 6.0 application to server ?
If somebody could help out !
Thanks,
Tuhina
Winsock Request
I have a Winsock component setup right now on my network, exact same as whats in this thread
I would like to know if a similar control can be built using Winsock to do this:
1) Connect to a remote computer, by IP address. (I have a code that determines the IP address of the remote machine already..)
2) Open a .txt file, send it back to (my) the users computer and displays it in a text box on screen.
3) On command button press, take what ever is in my text box, and send the file back to the remote computer and save it.
Kind of like editing a configuration file, remotly.
I know the application would have to be running on the remote end as well as my end for this to work, if its at all possible.
I would really like to do this, I appeciate everyones help in advance!
Winsock Example Request
I'm at work where I can't get to any help files for winsock. Can somebody give me a quick example of the code required to create a winsock instance, including telling it to listen and respont to internet requests? I'm going to attempt to make MS Access act like a simple server, and I just don't have the resources here to get it running. Thanks!
Winsock HTTP Request Help
I need help with this, my wrapper uses winsock to send requests and the close event does not fire which makes the connection stay open forever, my wrapper is at the bottom it is a attachment
WinSock Request Accept
Hey,
I have been trying to get this code to work, It's most likely something stupid am doing, but i cant get my server program type thingie to accept the Request ID from the client program thingie... Here is the code to the part that it says is wrong (If you need anyother parts tell me an i'll post it)
Code:
Private Sub HostSocket_ConnectionRequest(ByVal requestID As Long)
'Show Request In Host Log
HMsg = "Connection request id " & requestID & " from " & HostSocket.RemoteHostIP
HostLog.AddItem (HMsg)
sRequestID = requestID
iSockets = iSockets + 1
ConNumber.Caption = iSockets
Load HostSocket(iSockets)
HostSocket.LocalPort = 1007
HostSocket.Accept requestID
End Sub
PS. I looked at an example to help me with this, so am not sure whats wrong.
Thx in advance.
Ali.
Can Winsock DLL Do Other Protocol Request ...
guys,
i find that the winsock OCX really is limited in its capability...
can anyone suggest me a better one for network programming? because the protocol type is limited to a few only....
I hope to do RTSP / RTP request ... is there any thing that i can used to do that ???
can Winsock Dll do other protocol request or its the total same with the winsock OCX?
Does anyone has a sample using winsock DLL (as client)...??
Multiple Request With Winsock
Greeting,
I have a little problem with winsock. I have a server and several
client. I want to transfer text from server to client trough the network
In this case, I using winsock to transfer the text. It is ok when only 2
computer connected (1 server and 1 client). But, when 3 computer
Connected (1 server and 2 client) I cant broadcast text to all client.
Does any body know how to broadcast text fom server to client trough the
network and winsock?
thanks
Rgds,
Rano Nugrah Agung Homan
Winsock Sample Request
Hi all,
I need to make a server app for my project. I have concluded that I will need to implement Winsock to do so. I have read up on all Winsock articles here (and many others elsewhere) and have downloaded and studied all the samples I could find.
However, I am unable to do what I want because:
- The tutorials say that the IP address or friendly name of the target computer MUST be specified for the Winsock control to connect on the other side. This strikes me as very backward, as I can not always know what IP addresses my customers' network stations will be running on and cannot also predict their friendly names. Does this have to be hard-coded?
- Try as I may, I cannot create a working sample of Server.Exe and Client.Exe to run on the same machine as I cannot afford the luxury of testing my code over two machines. Is there any way I can debug / test on one machine?
If any member proficient with Winsock (Laura Stephens and Jason Rogers come to mind) would like to help, I shall appreciate a small sample to get me started by solving the above two problems.
GoodGuy
Experience is a bad teacher for its exams precede its lessons.
Edited by - GoodGuy on 12/10/2007 10:23:30 PM
Winsock Array Connection Request
i made a post a couple days back gavino answered
im trying to make my multi chat program and well, it isnt goin by too well. for starters the client cant connect
Code:
Private Sub sckSocket_ConnectionRequest(Index As Integer, ByVal requestID As Long)
SockNum = SockNum + 1
Load sckSocket(SockNum)
sckSocket(SockNum).Listen
sckSocket(SockNum).Accept requestID
End Sub
is there sumthing wrong with that?
[VB6] Winsock POST Request Problem
I'm trying to connecto to google.com and translate a simple word (just to test if works).
And I have a problem when I'm sending POST request data, here is my code:
Code:
Private Sub Command1_Click()
Winsock1.Close
Winsock1.Connect "www.google.com", "80"
End Sub
Private Sub Winsock1_Connect()
Dim packet As String
Dim strpost As String
strpost = "hl=it&ie=UTF8&text=hello&sl=en&sl=en&tl=it&tl=it"
packet = "POST /translate_t HTTP/1.1" & vbCrLf
packet = packet & "Host: www.google.com" & vbCrLf
packet = packet & "Accept: */*" & vbCrLf
packet = packet & "Accept-Language: it,it-it;q=0.8,en;q=0.5,en-us;q=0.3" & vbCrLf & vbCrLf
packet = packet & "Content-Type: " & "application/x-www-form-urlencoded" & vbCrLf
packet = packet & "Content-Length: " & Len(strpost) & vbCrLf
packet = packet & strpost
Winsock1.SendData packet
Text1.Text = Text1.Text & packet
End Sub
Private Sub Winsock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Winsock1.GetData data
Text2.Text = Text2.Text & data & vbCrLf
End Sub
As you can see I want the GETDATA in Text2.Text but I recieve this error:
Code:
HTTP/1.1 411 Length Required
Date: Fri, 01 Aug 2008 13:57:24 GMT
Content-Type: text/html; charset=UTF-8
Server: GFE/1.3
Content-Length: 1357
{html code}
What's the problem?!
Thanks in advance.
WinSock Connection Request Error!
When I use this code for a winsock connection request:
Code:
Private Sub Winsock1_ConnectionRequest(ByVal requestID As Long)
Winsock1.Accept requestID
txtRecive.Text = txtRecive.Text & vbCrLf & "ChatX: Connection Request Detected."
End Sub
I get runtime error 40020:
Invalid operation at current state
when I hit debug it highlights that code snippet up there! HELP
Winsock Server Connection Request Problem
hey, this is my code
Code:
Private Sub wskServer_ConnectionRequest(ByVal requestID As Long)
Dim msgboxResult
msgboxResult = MsgBox("A connect request has been initiated by: " & wskServer.RemoteHostIP & vbNewLine & "Would you like to accept it?", vbYesNo, "Connection Request")
If msgboxResult = vbYes Then
wskServer.Accept requestID
isServer = True
End If
End Sub
now the problem is, whenever i run it, and have a client try to connect to it, this is the error the server gives me on this line "wskServer.Accept requestID"
---------------------------
Project1
---------------------------
Run-time error '40020':
Invalid operation at current state
---------------------------
OK
---------------------------
can someone help?
EDIT: and yes, i did try:
wskServer.Close
wskServer.Accept requestID
but it doesn't work. if u need 2 see my whole code to know whats going on, just let me know
Winsock/cookie Request Entity Too Large...
hi i'm sending a cookie header via winsock but i think it's to large cause I'm receiving a "Request Entity Too Large" in the HTTP Response. is there a way around this?
Winsock - Notification When User Accepts Request
Does anyone know of a way that an initiator of a Winsock connection can be notified when a user on the other end accepts the connection ? I'm new to Winsock, so my terminology might not be the best, but I'm trying to find out if the inititator has any way of knowing that a connection was made before any messages are exchanged?
Thanks for any help....
HELP: Winsock To Send HTTP POST REQUEST To A Machine
Hello,
I would like to use visual basic to send data to a machine using an HTTP Post request, and cannot decide on the best way to do it. Can I use winsock. Please bear in mind the following.
I am sending a mult-part message (kind of like an email with attachments). It's actually a multimedia message in the MM7 format -> this is similar to email, a multipart MIME message.
I MUST post to a destination using the following format:
http://192.168.3.75:2097/mm7
I need to then send the data which I've formated according to the MM7 spec.
I need to receive responses from the receving application.
Any help would be greatly appreciated.
Thanks
Ben
Winsock On A Webpage
I am curious if i can use a winsock control of a webpage or a form on a webpage to make the page connect to a server somewhere. So i can make a chat on a webpage. Any advice or code or anything would be great.
Winsock, Http, Not Reading All Of Webpage
I am using a winsock to read a webpage, but not all the html comes through, only about 3/4 or 1/2 of it does. Would this be because of the website, being slow. Anyway i can work around that?
Thanks
Shell IE, Load Webpage & Log Whether Webpage Loads Or Not
Dear all,
How would I go about opening up Internet Explorer, loading a webpage (www.yahoo.com) and reporting back to VB whether the request was successful or not.
I'd like to perform this routine as a way of checking that my PC can connect to the internet... as if it can't, it would be a big indicator that our proxy server has gone down or needs restarting. (I'm writing a network monitoring program)
I'm getting as far as shelling IEXPLORE.exe... but I am then lost as to how to request a website and also a way of checking whether the website loads or not.. Could anyone please offer me some assistance?
Thanks in advance....
Winsock Connection Prob: &"Request To Connection Time Out&".
Hi All,
I am developing chat application like Yahoo and MSN messenger. Also i have almost completed it. I have two applications one is server appliation which will be run on chat server machine. the other is client appliation which will be used at any corner of the world.
Its working fine on my network. Ya, it is also working fine over network but with some misbehaviour. Sometimesm, it allow someone to login and sometimes it doesn't and gives "Request to connection time out" error.. I can't find the reason y it is happening.
I have developed this in visual basic and used winsock control.
Https
Ok, I am losing my mind. I did ask this on WinSockVB, but nothing, so I thought I would try here.
I have an application that will need to post data to a website using HTTPS. HTTP was easy, but I am not sure where to start using the winsock control and https. Any thoughts?
Thanks in advance.
Https
I was just curious, do you know what information needs to be sent to HTTPS to gain data retrieval? (winsock)
XML Over HTTPS
Hi!
I'm using VB6 and POsting data to a Java Servlet using XML over HTTPS. I'm able to connect and getting Status code = 200 and readyState = 4 , But I'm not getting any response from the servlet.
Here is my code:
On Error GoTo ErrHandler
Dim oXMLHTTP As New MSXML2.XMLHTTP
Dim sXMLInput As String
Dim sXMLOutPut As MSXML2.DOMDocument
Dim oFS As New Scripting.FileSystemObject
Dim oFile As TextStream
Dim oConn As New ADODB.Connection
Dim sOutPutFile As String
Dim ChkInt As Integer
HTTPPOSTURL = "https://< site address >"
sOutPutFile = App.Path & "OutPutData.xml"
sXMLInput = ""
sXMLInput = "USER=Userid&KEY=Password&PREORDERQRY=< my xml string>
If Trim(sXMLInput) <> "" Then
oXMLHTTP.Open "Post", HTTPPOSTURL, False
oXMLHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
oXMLHTTP.setRequestHeader "contenttype", "multipart/form-data"
oXMLHTTP.setRequestHeader "enctype", "multipart/form-data"
oXMLHTTP.setRequestHeader "postmode", "multipart form"
oXMLHTTP.setRequestHeader "CharSet", "UTF-8"
oXMLHTTP.send sXMLInput
sXMLOutPut = oXMLHTTP.responseXML
Set oFile = oFS.CreateTextFile(sOutPutFile, True)
oFile.Write (sXMLOutPut)
SSL/HTTPS In VB6
I have to download secure information from the web and I don't know where to start. I know I need to implement a client application that uses HTTPS to connect to the specific server.
How do I get my app to support HTTPS connections/SSL v3 connections?
I'm using VB6 and it will probably reside on an NT4 box.
Any help would be appreciated
SSL/HTTPS In VB6
I have to download secure information from the web and I don't know where to start. I know I need to implement a client application that uses HTTPS to connect to the specific server.
How do I get my app to support HTTPS connections/SSL v3 connections?
I'm using VB6 and it will probably reside on an NT4 box.
Any help would be appreciated
Need Help: Download From HTTPS
I have been charged w/ the task of pulling a flat file (.csv) from an HTTPS site and pushing that file to our file share. The web server is hosted by an ASP, thus there is a simple authentication form w/ username and password fields. I need a script that will authenticate itself to the web server, save the file locally and then copy the file to the file share. Here is what I have tried thus far but have not been able to successfully compile. Please look over this code and tell me where I went wrong. My background is mostly VB Script and C++ so I could just be simple syntax problems. Thanks
Private Sub Form_Load()
Dim strCsv As String
Dim oFso As Scripting.FileSystemObject
Dim oTs As Scripting.OpenTextFile
' set the protocol to HTTPS
Inet1.Protocol = icHTTPS
Inet1.Execute myURL, "HEAD", "Authorization: Basic " & myUID & ":" & myPWD
' get the file as a string from the https web server
strCsv = Inet1.OpenURL("https://www.wherethefileis.com)", icString)
Set oFso = New Scripting.FileSystemObject
Set oTs = oFso.OpenTextFile("\uncshare hecsvfile.csv", ForWriting, True)
oTs.Write strCsv
oTs.Close
Unload Me
End Sub
Public Sub FileCopy(sourceFolder As String, destFolder As String)
Dim objFSO As Object, fFolder, fFiles, eFile
Set objFSO = CreatObject("scripting.FileSystemObject")
Set fFolder = objFSO.GetFolder(sourceFolder)
Set fFiles = fFolder.Files
For Each eFile In fFiles
FileCopy eFile, destFolder & "" & eFile.Name
Debug.Print eFile & "copied"
Set fFiles = Nothing
Set fFolder = Nothing
Set objFSO = Nothing
End Sub
Web Folders (https)
can anyone help me
I am creating a program in which it will automatically log into a web folder and then maybe link it to say a dirlistbox or filelistbox or whatever. is that possible?
HTTPS Get/Post
Hi,
Looking for some links/samples about how to Get/Post data with HTTPS.
Thanx in advance.
URLDownloadToFile And HTTPS
I wrote a program that uses the WebBrowser control in order to load and recover some Web pages.
Then I had used the URLDownloadToFile function in order to save these pages on my disc.
This solution was corrected in the past, but now I must recover some pages that use the HTTPS protocol, and when I tried to run my program, the URLDownloadToFile fails.
Someone can tell me why?
Can I use the URLDownloadToFile function with HTTPS protocol?
If no, how can I save my pages without?
Note: I have need to save the pages in invisibile and silent way for the user. He does not have to see the save prompt.
Thanks
Download URL (https:\....)
I know that you can use the INET command to download the html source of a website e.g
Source = Inet1.OpenURL("http://www.yahoo.com")
BUT
this appears not to work for a secured website i.e https://.... Why is this? There is no problem viewing the code with view source from IE, so how come I cant download it. Is there another way perhaps?
Thanks.
Https Headers
How do I view the https headers on a HTTPS page that is controlled by the Webbrowser control. Any help would be appreciated. Thanks!
Help - XML Via HTTPS Fails.
I have searched the forums of the world for the past 3 days and come up with 3 ways to send an XML document using VB6. Every method fails for me that have worked for others.
Please help. Here is the most promising code I have tried:
Sub three()
On Error GoTo eh_3
Dim oXMLHttp As MSXML2.ServerXMLHTTP
Dim oDoc As New MSXML2.DOMDocument30
Set oXMLHttp = New MSXML2.ServerXMLHTTP
If Not oDoc.loadXML("<Message>asdf</Message>") Then Stop
oXMLHttp.open "POST", "https://uat-cld.lasallebank.com/VendorDownloads/AAMGLNB", False
oXMLHttp.setRequestHeader "Content-Type", "text/xml" '"application/x-www-form-urlencoded " '"text/xml"
oXMLHttp.send oDoc 'Line produces error "A connection with the server could not be established"
Set oXMLHttp = Nothing
Debug.Print oXMLHttp.Status & " - " & oXMLHttp.statusText
Stop
eh_3:
Debug.Print oXMLHttp.Status & " - " & oXMLHttp.statusText
Debug.Print Err.Description
Stop
End Sub
Any help appreciated. I am not strong with XML or with setting up environments but have many years with VB.
Will
HTTPS GET/POST Using API
I hate having to include OCX's like MSINET with my projects, because many computers need to register them before being used, which alot of people dont know how to do. Is there any way of using API's to send GET and POST requests to secure websites and get the HTML source back?
|