Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

I have a theory that it's impossible to prove anything, but I can't prove it.


devel / comp.lang.tcl / Tclhttpd not working on ports

SubjectAuthor
* Tclhttpd not working on portsShaun Kulesa
`- Tclhttpd not working on portsDanilo Chang

1
Tclhttpd not working on ports

<1407fb03-8b00-4199-be11-4b946b114592n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12387&group=comp.lang.tcl#12387

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a0c:d6ca:0:b0:670:f2a1:a0a0 with SMTP id l10-20020a0cd6ca000000b00670f2a1a0a0mr22666qvi.12.1699443148855;
Wed, 08 Nov 2023 03:32:28 -0800 (PST)
X-Received: by 2002:a9d:5e82:0:b0:6b8:6cec:b73e with SMTP id
f2-20020a9d5e82000000b006b86cecb73emr406563otl.5.1699443148608; Wed, 08 Nov
2023 03:32:28 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Wed, 8 Nov 2023 03:32:28 -0800 (PST)
Injection-Info: google-groups.googlegroups.com; posting-host=139.222.233.73; posting-account=Be2r4goAAACg4Ko_BkJ0V-RlkGAdXGng
NNTP-Posting-Host: 139.222.233.73
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1407fb03-8b00-4199-be11-4b946b114592n@googlegroups.com>
Subject: Tclhttpd not working on ports
From: shaunkul...@gmail.com (Shaun Kulesa)
Injection-Date: Wed, 08 Nov 2023 11:32:28 +0000
Content-Type: text/plain; charset="UTF-8"
X-Received-Bytes: 2049
 by: Shaun Kulesa - Wed, 8 Nov 2023 11:32 UTC

I'm trying to run the tclhttpd web server example but every port I try on my university wifi or my remote linux virtual machine it will say the port is already in use.

couldn't open socket: address already in use
while executing
"socket -server [namespace code [list my connect]] -myaddr $ip $port"
(class "::httpd::server" method "start" line 20)
invoked from within
"HTTPD start"

I then try the python http server on the same port afterwards and it works.

package require httpd

httpd::server create HTTPD port 8039

HTTPD start

# Add in a dict based dispatcher
HTTPD plugin dispatch ::httpd::plugin.dict_dispatch
# Register the /hello uri to be answered by our new class
HTTPD uri add * /hello {mixin {content reply.hello}}

oo::class create ::reply.hello {
method content {} {
my puts "<HTML><HEAD><TITLE>My Example Server</TITLE></HEAD><BODY>"
my puts "<h1>Hello World!</h1>"
my puts "Nice to see you from [my request get REMOTE_HOST]"
my puts "The time is now [clock format [clock seconds]]"
my puts </BODY></HTML>
}
}

Re: Tclhttpd not working on ports

<37604700-520b-4c41-850c-0f3e61bbe643n@googlegroups.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=12390&group=comp.lang.tcl#12390

  copy link   Newsgroups: comp.lang.tcl
X-Received: by 2002:a05:620a:1a19:b0:76d:8827:11a5 with SMTP id bk25-20020a05620a1a1900b0076d882711a5mr232462qkb.5.1699625071434;
Fri, 10 Nov 2023 06:04:31 -0800 (PST)
X-Received: by 2002:a17:902:aa08:b0:1cc:ec22:64df with SMTP id
be8-20020a170902aa0800b001ccec2264dfmr1228962plb.2.1699625070908; Fri, 10 Nov
2023 06:04:30 -0800 (PST)
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.tcl
Date: Fri, 10 Nov 2023 06:04:30 -0800 (PST)
In-Reply-To: <1407fb03-8b00-4199-be11-4b946b114592n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2001:b011:b808:7679:580:6bbd:cd1d:17d2;
posting-account=7HuFrAoAAACeXIF134GSJY6Z38FI_aXp
NNTP-Posting-Host: 2001:b011:b808:7679:580:6bbd:cd1d:17d2
References: <1407fb03-8b00-4199-be11-4b946b114592n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <37604700-520b-4c41-850c-0f3e61bbe643n@googlegroups.com>
Subject: Re: Tclhttpd not working on ports
From: ray2...@gmail.com (Danilo Chang)
Injection-Date: Fri, 10 Nov 2023 14:04:31 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Received-Bytes: 3621
 by: Danilo Chang - Fri, 10 Nov 2023 14:04 UTC

Shaun Kulesa 在 2023年11月8日 星期三晚上7:32:31 [UTC+8] 的信中寫道:
> I'm trying to run the tclhttpd web server example but every port I try on my university wifi or my remote linux virtual machine it will say the port is already in use.
>
> couldn't open socket: address already in use
> while executing
> "socket -server [namespace code [list my connect]] -myaddr $ip $port"
> (class "::httpd::server" method "start" line 20)
> invoked from within
> "HTTPD start"
>
> I then try the python http server on the same port afterwards and it works.
>
> package require httpd
>
> httpd::server create HTTPD port 8039
>
> HTTPD start
>
> # Add in a dict based dispatcher
> HTTPD plugin dispatch ::httpd::plugin.dict_dispatch
> # Register the /hello uri to be answered by our new class
> HTTPD uri add * /hello {mixin {content reply.hello}}
>
> oo::class create ::reply.hello {
> method content {} {
> my puts "<HTML><HEAD><TITLE>My Example Server</TITLE></HEAD><BODY>"
> my puts "<h1>Hello World!</h1>"
> my puts "Nice to see you from [my request get REMOTE_HOST]"
> my puts "The time is now [clock format [clock seconds]]"
> my puts </BODY></HTML>
> }
> }

Hello,

I test in httpd 4.3.5.
I think you can try to remove "HTTPD start" this line, because it is not necessary.

And modify
HTTPD uri add * /hello {mixin {content reply.hello}}
To
HTTPD uri add * /hello [list mixin {content ::reply.hello}]

And if you are not in interactive mode, maybe you need to add "vwait forever" in last line.
So the script will be:

package require httpd

httpd::server create HTTPD port 8039

# Add in a dict based dispatcher
HTTPD plugin basic_url ::httpd::plugin.dict_dispatch
# Register the /hello uri to be answered by our new class
HTTPD uri add * /hello [list mixin {content reply.hello}]

clay::define ::reply.hello {
method content {} {
my puts "<HTML><HEAD><TITLE>My Example Server</TITLE></HEAD><BODY>"
my puts "<h1>Hello World!</h1>"
my puts "Nice to see you from [my request get REMOTE_HOST]"
my puts "The time is now [clock format [clock seconds]]"
my puts </BODY></HTML>
}
}

# If not in interactive mode
vwait forever

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor