Forum Discussion
ejohnson_27643
Nimbostratus
Apr 20, 2007Problems creating a Network Tunnel with API
I'm trying to create a Network Tunnel using the API. I tried to follow the steps listed in this post:
http://devcentral.f5.com/Default.aspx?tabid=53&forumid=4&postid=4013&view=topic
I took the sample VB6 AppTunnel application and replaced "APP TUNNEL" with "VPN" in appropriate locations. However, when I try to connect, the AppTunnel Application seems to make a network connection, but the URL that is connects to is not the same as the one I entered...which is possibly expected normal behavior, but when I do an ipconfig /all, there is only one network connection shown, whereas when I use the F5 client, there's two.
I've attached a screen shot of the AppTunnel application when it's connected (if it helps).
Here's my source code where I made replacements:
Private Sub AppTunnel_OnOpenSession(ByVal szWebtopUrl As String)
' Clear favorites list box
lb_Favorites.Clear
'Enable favorites frame box
Frame2.Enabled = True
'cleanup statistics
lReceived = 0
lSent = 0
l_Sent.Caption = ""
l_Received.Caption = ""
'dispaly message
l_Status.Caption = "Connected to " + szWebtopUrl
' Get favorites for APPTUNNELs
AppTunnel.GetFavorites "VPN"
End Sub
Private Sub btn_Open_Click()
Dim Name As String ' Favorite name variable
' Loop through favorite list
For i = 0 To lb_Favorites.ListCount - 1
' Open selected favorite
If lb_Favorites.Selected(i) Then
' Get favorite name
Name = lb_Favorites.List(i)
'Open favorite connection
AppTunnel.OpenByName "VPN", Name
End If
Next i
End Sub
Private Sub btn_Close_Click()
Dim Name As String ' Favorite name varible
For i = 0 To lb_Favorites.ListCount - 1
If lb_Favorites.Selected(i) Then
' Get favorite name
Name = lb_Favorites.List(i)
' Close favorite connection
AppTunnel.Close "VPN", Name
End If
Next i
End Sub
Any suggestions or ideas are welcome!
2 Replies
- Alexander_Kova1Historic F5 AccountFavorite name is not highlighted\selected on the application picture above.
There is a ‘Loop through favorite list’ in btn_Open_Click(). There is no error handling in the code and if favorite is not selected you application will skip OpenByName without any notification.
This code can be rearranged to notify user or open first connection automatically (if only one connection name is displayed).
If this example is based on VB6 sample you application might display something like "Connected: you_favorite_name" or "some_error: you_favorite_name" instead of Connected to http://..." on establishing VPN connection.
Please let me know if this works.
--
Regards,
Alexander - ejohnson_27643
Nimbostratus
That worked! Sorry for the late response.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects
