This is a nice and simple tutorial on how to integrate a proxy system into your application. With these easy steps we will have you up and running with your own proxy integration, that will allow you to change your ip in your application.
Step 1) Add a brand new module to your visual basic project as seen in the image below, name it Proxy.vb and click add
Step 2) Add this code to your proxy module. This is what your code should look like after you are done.
Module Proxy
' The structure we use for the information
' to be interpreted correctly by API.
Public Structure Struct_INTERNET_PROXY_INFO
Public dwAccessType As Integer
Public proxy As IntPtr
Public proxyBypass As IntPtr
End Structure
' The Windows API function that allows us to manipulate
' IE settings programmatically.
Private Declare Auto Function InternetSetOption Lib "wininet.dll" _
(ByVal hInternet As IntPtr, ByVal dwOption As Integer, ByVal lpBuffer As IntPtr, _
ByVal lpdwBufferLength As Integer) As Boolean
' The function we will be using to set the proxy settings.
Public Sub RefreshIESettings(ByVal strProxy As String)
Const INTERNET_OPTION_PROXY As Integer = 38
Const INTERNET_OPEN_TYPE_PROXY As Integer = 3
Dim struct_IPI As Struct_INTERNET_PROXY_INFO
' Filling in structure
struct_IPI.dwAccessType = INTERNET_OPEN_TYPE_PROXY
struct_IPI.proxy = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi(strProxy)
struct_IPI.proxyBypass = System.Runtime.InteropServices.Marshal.StringToHGlobalAnsi("local")
' Allocating memory
Dim intptrStruct As IntPtr = System.Runtime.InteropServices.Marshal.AllocCoTaskMem(System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI))
' Converting structure to IntPtr
System.Runtime.InteropServices.Marshal.StructureToPtr(struct_IPI, intptrStruct, True)
Dim iReturn As Boolean = InternetSetOption(IntPtr.Zero, INTERNET_OPTION_PROXY, intptrStruct, System.Runtime.InteropServices.Marshal.SizeOf(struct_IPI))
End Sub
End Module
Step 3) To easily Change your proxy within your application ....all you need to do is this code.
Proxy.RefreshIESettings("proxy:ip") 'Make sure your ip looks like "111.111.1.1:80"
Hopefully this guide has belped you and if you need any help let me know.
A next tut might be how to spoof your browser and referrer and how to make it look like you are using different internet browsers.
No comments:
Post a Comment