9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
* [9fans] telnet to port (and webfs debug)
@ 2015-02-12 11:02 Giacomo Tesio
  2015-02-12 11:57 ` lucio
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Giacomo Tesio @ 2015-02-12 11:02 UTC (permalink / raw)
  To: 9front, Fans of the OS Plan 9 from Bell Labs

Hi, I'm having an hard time to debug a problem with http clients in
plan9/qemu (actually 9front, but I guess my questions apply to all
plan9 versions).

DNS and ping works properly, just http fails.

I suspect it's a proxy issue. I have set httpproxy environment
variable but with no success: both hget and mothra doesn't works.

I can connect to the qemu host webserver on port 80 and receive the
proper page, but for any other address I can't obtain a response.

The proxy does not log any access.

Now, to debug this issue, I'd like to telnet the proxy port and
manually forge an http request.

However I can't understand hot to specify a port reading man telnet.

What's plan9 equivalent of

   telnet www.google.com 80



Giacomo



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-12 11:02 [9fans] telnet to port (and webfs debug) Giacomo Tesio
@ 2015-02-12 11:57 ` lucio
  2015-02-12 12:07 ` Quintile
  2015-02-12 16:27 ` cinap_lenrek
  2 siblings, 0 replies; 16+ messages in thread
From: lucio @ 2015-02-12 11:57 UTC (permalink / raw)
  To: 9fans

>    telnet www.google.com 80

telnet tcp!www.google.com!80

some bits are optional.  Check dial(2).

Lucio.




^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-12 11:02 [9fans] telnet to port (and webfs debug) Giacomo Tesio
  2015-02-12 11:57 ` lucio
@ 2015-02-12 12:07 ` Quintile
  2015-02-12 12:46   ` Giacomo Tesio
  2015-02-12 16:27 ` cinap_lenrek
  2 siblings, 1 reply; 16+ messages in thread
From: Quintile @ 2015-02-12 12:07 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

I have s feeling that get is a script that accesses webfs, and maybe the 9front mothers does the same. are you running webfs?

-Steve





> On 12 Feb 2015, at 11:02, Giacomo Tesio <giacomo@tesio.it> wrote:
> 
> Hi, I'm having an hard time to debug a problem with http clients in
> plan9/qemu (actually 9front, but I guess my questions apply to all
> plan9 versions).
> 
> DNS and ping works properly, just http fails.
> 
> I suspect it's a proxy issue. I have set httpproxy environment
> variable but with no success: both hget and mothra doesn't works.
> 
> I can connect to the qemu host webserver on port 80 and receive the
> proper page, but for any other address I can't obtain a response.
> 
> The proxy does not log any access.
> 
> Now, to debug this issue, I'd like to telnet the proxy port and
> manually forge an http request.
> 
> However I can't understand hot to specify a port reading man telnet.
> 
> What's plan9 equivalent of
> 
>   telnet www.google.com 80
> 
> 
> 
> Giacomo



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-12 12:07 ` Quintile
@ 2015-02-12 12:46   ` Giacomo Tesio
  0 siblings, 0 replies; 16+ messages in thread
From: Giacomo Tesio @ 2015-02-12 12:46 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 1218 bytes --]

Yes hget is an rc script running on webfs.

Giacomo
Il 12/Feb/2015 13:14 "Quintile" <steve@quintile.net> ha scritto:

> I have s feeling that get is a script that accesses webfs, and maybe the
> 9front mothers does the same. are you running webfs?
>
> -Steve
>
>
>
>
>
> > On 12 Feb 2015, at 11:02, Giacomo Tesio <giacomo@tesio.it> wrote:
> >
> > Hi, I'm having an hard time to debug a problem with http clients in
> > plan9/qemu (actually 9front, but I guess my questions apply to all
> > plan9 versions).
> >
> > DNS and ping works properly, just http fails.
> >
> > I suspect it's a proxy issue. I have set httpproxy environment
> > variable but with no success: both hget and mothra doesn't works.
> >
> > I can connect to the qemu host webserver on port 80 and receive the
> > proper page, but for any other address I can't obtain a response.
> >
> > The proxy does not log any access.
> >
> > Now, to debug this issue, I'd like to telnet the proxy port and
> > manually forge an http request.
> >
> > However I can't understand hot to specify a port reading man telnet.
> >
> > What's plan9 equivalent of
> >
> >   telnet www.google.com 80
> >
> >
> >
> > Giacomo
>
>

[-- Attachment #2: Type: text/html, Size: 1758 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-12 11:02 [9fans] telnet to port (and webfs debug) Giacomo Tesio
  2015-02-12 11:57 ` lucio
  2015-02-12 12:07 ` Quintile
@ 2015-02-12 16:27 ` cinap_lenrek
  2015-02-13  8:50   ` Giacomo Tesio
  2 siblings, 1 reply; 16+ messages in thread
From: cinap_lenrek @ 2015-02-12 16:27 UTC (permalink / raw)
  To: 9fans

the httpproxy variable is read by webfs on startup only. webfs is usually
started in your $home/lib/profile to provide http client service.

just setting httpproxy before running hget or mothra has no
effect on the proxy setting unless you start a new webfs instance.

so try:

httpproxy=http://proxy:port
webfs
hget http://www.google.com/

when that works, set the httpproxy variable at the top of your
$home/lib/profile before webfs is started to make it permanent.

--
cinap



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-12 16:27 ` cinap_lenrek
@ 2015-02-13  8:50   ` Giacomo Tesio
  2015-02-13  9:11     ` cinap_lenrek
  0 siblings, 1 reply; 16+ messages in thread
From: Giacomo Tesio @ 2015-02-13  8:50 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs, 9front

I did already tried this, but without success, but I tried it again
just to be sure, still without success.

I tried to telnet the proxy with telnet tcp!host!port and it worked as
expected ("GET http://www.google.com" printed its bloated html).

This limit the issue boundaries to webfs (since, as far as I can see,
hget is "just" a wrapper of it), since both squid and the tcp stack
proved to work properly.


The problem is, I can't figure out how to debug webfs. Any tip?

Note that it worked once, a few days ago, when I managed to sysupdate
(setting http_proxy.host in /usr/glenda/.hgrc).



Giacomo



2015-02-12 17:27 GMT+01:00  <cinap_lenrek@felloff.net>:
> the httpproxy variable is read by webfs on startup only. webfs is usually
> started in your $home/lib/profile to provide http client service.
>
> just setting httpproxy before running hget or mothra has no
> effect on the proxy setting unless you start a new webfs instance.
>
> so try:
>
> httpproxy=http://proxy:port
> webfs
> hget http://www.google.com/
>
> when that works, set the httpproxy variable at the top of your
> $home/lib/profile before webfs is started to make it permanent.
>
> --
> cinap
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-13  8:50   ` Giacomo Tesio
@ 2015-02-13  9:11     ` cinap_lenrek
  2015-02-13  9:59       ` Giacomo Tesio
  2015-02-13 14:13       ` erik quanstrom
  0 siblings, 2 replies; 16+ messages in thread
From: cinap_lenrek @ 2015-02-13  9:11 UTC (permalink / raw)
  To: 9fans

heres how it should look like (tuttle.9hal:8888 is my proxy servr):

term% httpproxy=http://tuttle.9hal:8888 webfs -d; hget http://google.com
clientctl: url http://google.com
http(0): GET http://google.com/
hdial [1] tcp!tuttle.9hal!8888
-> GET http://google.com/ HTTP/1.1
Host: google.com
User-Agent: Mozilla/5.0 (compatible; hjdicks)
Connection: keep-alive
Referer: http://google.com/
Accept: */*

<- HTTP/1.1 302 Found

--
cinap



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-13  9:11     ` cinap_lenrek
@ 2015-02-13  9:59       ` Giacomo Tesio
  2015-02-13 14:13       ` erik quanstrom
  1 sibling, 0 replies; 16+ messages in thread
From: Giacomo Tesio @ 2015-02-13  9:59 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs, 9front

Ok fixed. The problem was plain stupid: I did not prepended "http://"
to httpproxy, setting it to just proxy:port.

However, I noted that webfs -d option is not documented. Nor is the
need to prepend http:// to httpproxy (I suppose however that this
could be taken as default).
Whenever I'll find my way to acme and plan9 I'll send you a patch...


Thanks you all for your help!


Giacomo


2015-02-13 10:11 GMT+01:00  <cinap_lenrek@felloff.net>:
> heres how it should look like (tuttle.9hal:8888 is my proxy servr):
>
> term% httpproxy=http://tuttle.9hal:8888 webfs -d; hget http://google.com
> clientctl: url http://google.com
> http(0): GET http://google.com/
> hdial [1] tcp!tuttle.9hal!8888
> -> GET http://google.com/ HTTP/1.1
> Host: google.com
> User-Agent: Mozilla/5.0 (compatible; hjdicks)
> Connection: keep-alive
> Referer: http://google.com/
> Accept: */*
>
> <- HTTP/1.1 302 Found
>
> --
> cinap
>



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-13  9:11     ` cinap_lenrek
  2015-02-13  9:59       ` Giacomo Tesio
@ 2015-02-13 14:13       ` erik quanstrom
  2015-02-13 15:23         ` Charles Forsyth
  1 sibling, 1 reply; 16+ messages in thread
From: erik quanstrom @ 2015-02-13 14:13 UTC (permalink / raw)
  To: 9fans

> User-Agent: Mozilla/5.0 (compatible; hjdicks)

does anybody remember what the hardware that inspired this was?
and why proper marshalling code couldn't be written.  c structures
can't really be trusted with memory layout.

- erik



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug)
  2015-02-13 14:13       ` erik quanstrom
@ 2015-02-13 15:23         ` Charles Forsyth
  0 siblings, 0 replies; 16+ messages in thread
From: Charles Forsyth @ 2015-02-13 15:23 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 401 bytes --]

On 13 February 2015 at 14:13, erik quanstrom <quanstro@quanstro.net> wrote:

> does anybody remember what the hardware that inspired this was?
> and why proper marshalling code couldn't be written.
>

It wasn't hardware: it was a large package of existing protocol code that
needed to run
but made too many assumptions about structure and structure member
alignments,
prompting the pragma.

[-- Attachment #2: Type: text/html, Size: 812 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug))
  2015-02-13 17:21   ` Steven Stallion
@ 2015-02-13 17:33     ` erik quanstrom
  0 siblings, 0 replies; 16+ messages in thread
From: erik quanstrom @ 2015-02-13 17:33 UTC (permalink / raw)
  To: 9fans

> No webfs required!
>
> There's a factotum extension I wrote a while back that is bundled with
> Mercurial version 2.2+:  http://mercurial.selenic.com/wiki/FactotumExtension.
> If you're using the mercurial contrib package from either jas or myself, it
> should be enabled by default.

thanks to both you and jas for the work on hg.

- erik



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug))
  2015-02-13 11:30 [9fans] telnet to port (and webfs debug)) Giacomo Tesio
  2015-02-13 11:54 ` cinap_lenrek
  2015-02-13 11:59 ` cinap_lenrek
@ 2015-02-13 17:29 ` Steven Stallion
  2 siblings, 0 replies; 16+ messages in thread
From: Steven Stallion @ 2015-02-13 17:29 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

On Fri, Feb 13, 2015 at 5:30 AM, Giacomo Tesio <giacomo@tesio.it> wrote:
>
> Note that, strangely enough, hg ignores the .hgrc in your home directory.
> The hgrc(8) speak about Unix (and Windows) but since GNU is Not U...
> ehm... Plan9 is not Unix (:-D), I can't say where to write it.
>

Hi Giacomo,

This might explain some of what you are seeing:
http://mercurial.selenic.com/wiki/Plan9FromBellLabs

Your hgrc should be placed under $home/lib.

Steve

[-- Attachment #2: Type: text/html, Size: 970 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug))
  2015-02-13 11:59 ` cinap_lenrek
@ 2015-02-13 17:21   ` Steven Stallion
  2015-02-13 17:33     ` erik quanstrom
  0 siblings, 1 reply; 16+ messages in thread
From: Steven Stallion @ 2015-02-13 17:21 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs

[-- Attachment #1: Type: text/plain, Size: 400 bytes --]

On Fri, Feb 13, 2015 at 5:59 AM, <cinap_lenrek@felloff.net> wrote:

> yes, patch would be welcome :-)
>

No webfs required!

There's a factotum extension I wrote a while back that is bundled with
Mercurial version 2.2+:  http://mercurial.selenic.com/wiki/FactotumExtension.
If you're using the mercurial contrib package from either jas or myself, it
should be enabled by default.

Steve

[-- Attachment #2: Type: text/html, Size: 892 bytes --]

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug))
  2015-02-13 11:30 [9fans] telnet to port (and webfs debug)) Giacomo Tesio
  2015-02-13 11:54 ` cinap_lenrek
@ 2015-02-13 11:59 ` cinap_lenrek
  2015-02-13 17:21   ` Steven Stallion
  2015-02-13 17:29 ` Steven Stallion
  2 siblings, 1 reply; 16+ messages in thread
From: cinap_lenrek @ 2015-02-13 11:59 UTC (permalink / raw)
  To: 9fans

yes, patch would be welcome :-)

--
cinap



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug))
  2015-02-13 11:30 [9fans] telnet to port (and webfs debug)) Giacomo Tesio
@ 2015-02-13 11:54 ` cinap_lenrek
  2015-02-13 11:59 ` cinap_lenrek
  2015-02-13 17:29 ` Steven Stallion
  2 siblings, 0 replies; 16+ messages in thread
From: cinap_lenrek @ 2015-02-13 11:54 UTC (permalink / raw)
  To: 9fans

hg is using ape port of python which comes with its own http library.
wrote a hg extentsion that makes it use webfs instead, so i can
keep my credentials in factotum/secstore:

[extensions]
hgwebfs=

in your $home/lib/hgrc

--
cinap



^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: [9fans] telnet to port (and webfs debug))
@ 2015-02-13 11:30 Giacomo Tesio
  2015-02-13 11:54 ` cinap_lenrek
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Giacomo Tesio @ 2015-02-13 11:30 UTC (permalink / raw)
  To: Fans of the OS Plan 9 from Bell Labs, 9front

For future reference: hg (and thus sysupdate) simply ignores
$httpproxy variable, it honors $http_proxy instead.
Thus if you are using plan9 behind a proxy you need to set

term% httpproxy=http://proxy.hostname:port # (don't forget "http://"!)
term% http_proxy=proxy.hostname:port

Once it works, you can add it at the beginning of your lib/profile.


Note that, strangely enough, hg ignores the .hgrc in your home directory.
The hgrc(8) speak about Unix (and Windows) but since GNU is Not U...
ehm... Plan9 is not Unix (:-D), I can't say where to write it.


Giacomo

2015-02-13 10:59 GMT+01:00 Giacomo Tesio <giacomo@tesio.it>:
> Ok fixed. The problem was plain stupid: I did not prepended "http://"
> to httpproxy, setting it to just proxy:port.
>
> However, I noted that webfs -d option is not documented. Nor is the
> need to prepend http:// to httpproxy (I suppose however that this
> could be taken as default).
> Whenever I'll find my way to acme and plan9 I'll send you a patch...
>
>
> Thanks you all for your help!
>
>
> Giacomo
>
>
> 2015-02-13 10:11 GMT+01:00  <cinap_lenrek@felloff.net>:
>> heres how it should look like (tuttle.9hal:8888 is my proxy servr):
>>
>> term% httpproxy=http://tuttle.9hal:8888 webfs -d; hget http://google.com
>> clientctl: url http://google.com
>> http(0): GET http://google.com/
>> hdial [1] tcp!tuttle.9hal!8888
>> -> GET http://google.com/ HTTP/1.1
>> Host: google.com
>> User-Agent: Mozilla/5.0 (compatible; hjdicks)
>> Connection: keep-alive
>> Referer: http://google.com/
>> Accept: */*
>>
>> <- HTTP/1.1 302 Found
>>
>> --
>> cinap
>>



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-02-13 17:33 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-12 11:02 [9fans] telnet to port (and webfs debug) Giacomo Tesio
2015-02-12 11:57 ` lucio
2015-02-12 12:07 ` Quintile
2015-02-12 12:46   ` Giacomo Tesio
2015-02-12 16:27 ` cinap_lenrek
2015-02-13  8:50   ` Giacomo Tesio
2015-02-13  9:11     ` cinap_lenrek
2015-02-13  9:59       ` Giacomo Tesio
2015-02-13 14:13       ` erik quanstrom
2015-02-13 15:23         ` Charles Forsyth
2015-02-13 11:30 [9fans] telnet to port (and webfs debug)) Giacomo Tesio
2015-02-13 11:54 ` cinap_lenrek
2015-02-13 11:59 ` cinap_lenrek
2015-02-13 17:21   ` Steven Stallion
2015-02-13 17:33     ` erik quanstrom
2015-02-13 17:29 ` Steven Stallion

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).