Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7809847
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T03:33:49+00:00 2026-06-02T03:33:49+00:00

I am playing with tclhttpd web server and found a strange error I start

  • 0

I am playing with tclhttpd web server and found a strange error

  1. I start tclhttpd at default port 8015
  2. Open firefox and navigate to http://localhost:8015

I see source of my index.html file instead of web page.

index.html is simple ( < and > are skipped ):

  html 
  head 
    title
      TEST 
    /title
  /head
  body
   H1 TEST HEADER /H1
  /body
  /html

Any ideas?

I have checked with the curl:

* About to connect() to localhost port 8015 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8015 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.3 (i386-pc-win32) libcurl/7.21.3 
  OpenSSL/0.9.8q zlib/1.2.5
> Host: localhost:8015
> Accept: */*

Server Response

 HTTP/1.1 200 Data follows
 Date: Thu, 12 Apr 2012 14:16:47 GMT
 Server: Tcl-Webserver/3.5.1 May 27, 2004
 Content-Type: text/plain
 Content-Length: 130
 Last-Modified: Thu, 12 Apr 2012 14:14:30 GMT

So, tclhttpd returns text/plain instead of text/html

Linux case

I have tried to check what would happened with Linux.

As tclkttpd is wrapped in kit I made the same test under Linux.
It looks like everything works fine.

curl -G -v localhost:8015

* About to connect() to localhost port 8015 (#0)
*   Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8015 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.7 (i686-pc-linux-gnu) libcurl/7.21.7
  OpenSSL/1.0.0d zlib/1.2.5 libssh2/1.2.7
> Host: localhost:8015
> Accept: */*

Server response

 HTTP/1.1 200 Data follows
 Date: Thu, 12 Apr 2012 17:25:29 GMT
 Server: Tcl-Webserver/3.5.1 May 27, 2004
 Content-Type: text/html
 Content-Length: 125
 Last-Modified: Thu, 12 Apr 2012 17:14:04 GMT

Deep research

I have modified some of the source files, to dump more information:

proc Mtype {path} {
   global MimeType

    set ext [string tolower [file extension $path]]
    Stderr "Mtype: path $path ext $ext"
    if {[info exist MimeType($ext)]} {
    Stderr "MimeType($ext) exists."
    Stderr "Print MimeType "
    set lst [lsort [array names MimeType]]
    foreach {i}  $lst {
        Stderr " $i $MimeType($i)"
    }
return $MimeType($ext)
  } else {
Stderr "Mimetype not found. ext $ext"
    Stderr "Print MimeType "
    set lst [lsort [array names MimeType]]
    foreach {i}  $lst {
        Stderr " $i $MimeType($i)"
    }

return text/plain
}
}

When I query http://localhost:8015
I got following output:

  • Linux
     Mtype: path /home/a2/src/tcl/tcl_www/doc/index.html ext .html
     MimeType(.html) exists.
     Print MimeType 
     text/plain
     .ai application/postscript
     .aif audio/x-aiff
     .aifc audio/x-aiff
     ....
     .hqx application/mac-binhex40
     .htm text/html
     .html text/html
     .i86pc application/octet-stream
     ...
     Default cmd Doc_text/html
  • Windows
     Look for Tcl proc whos name match the MIME Content-Type
     Mtype: path M:/apr/tcl_www/doc/index.html ext .html
     Mimetype not found. ext .html
     Print MimeType
      .man application/x-doctool
     Mtype M:/apr/tcl_www/doc/index.html  returns Doc_text/plain

So it look like there are troubles with reading mime.types

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T03:33:51+00:00Added an answer on June 2, 2026 at 3:33 am

    I have checked with the fresh tclkitsh and tclhttpd

    • tclkitsh-8.5.9-win32.upx.exe ( http://code.google.com/p/tclkit/downloads/list )
    • tclhttpd5.3.1.kit

    Everything works.

    If I use my “old” version of tclkitsh-win32.upx.exe
    I receive text/plain instead of text/html

    So it looks like there is a bug in my old wrapped interpretor, that leads to the problem with not reading mime.types.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Recently playing around with the open source iphone app code, and found it uses
Playing with the new(ish) url rewriting functionality for web forms, but I'm running into
iam playing around with OPEN CV from Intel with the associated PHP Extensions. Works
Playing with a few tutorials on sockets but struggling to connect. My tomcat server
been playing with http://openidenabled.com/php-openid/trunk/examples/consumer and tried the following: flim.blogspot.com flimcc.blogspot.com The first works, the
been playing around with Capistrano to get an automated deploy between my server and
Whilst playing around in an open source project, my attempt to ToString a DateTime
Playing with Git and GitHub,I found that sometimes a git commit -a is needed
Been playing around with node.js and I am developing a file uploading web app
Playing with excel and came up with this error Sub Split() Dim txt As

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.