Forum Discussion
James_Wrubel_48
Nimbostratus
Jun 27, 2009forware only http payload to pool
Hi all,
I've got a requirement to tunnel a TCP-based application over HTTP. We control the data the client sends, so I had intended to put the node and port in custom http headers and t...
James_Wrubel_48
Nimbostratus
Jul 03, 2009Okay this is mostly working - the thing that is tripping me up I think is just Tcl syntax. I'm parsing the IP address in dotted decimal format (along with the port) and assigning them to variables:
foreach val [split $qsVars] {
set qsName [getfield $val "=" 1]
set qsValue [decode_uri [getfield $val "=" 2]]
log local0. "\$val = $qsName, value = $qsValue"
switch -glob $qsName {
"data" {
set decoded_data [decode_uri $qsValue]
log local0.info "data = $decoded_data"
set vnc_payload $decoded_data
}
"host" {
set decoded_host [decode_uri $qsValue]
log local0.info "host = $decoded_host"
set remote_host $decoded_host
}
"\{port" {
set decoded_port [decode_uri $qsValue]
log local0.info "port = $decoded_port"
set remote_port $decoded_port
}
default {
}
}
}
The variables I'm assigning, $remote_host and $remote_port, are defined globally so I am sure it's not a scope issue. but when I try to do a:
use node $remote_host $remote_port
The server-side handshake never fires. I think what is happening is that the node command doesn't like the format of the remote_host variable - if I manually set it to the same exact address that's being parsed above it works fine. Does Tcl have the concept of casting to a strong type? I'm more of an OO programmer so I get tripped up by these kinds of things in other languages. I'm also testing now to see if I have a leading or training space issue.
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