Client IP address in MiServer 3
2 posts
• Page 1 of 1
Client IP address in MiServer 3
Hi,
I have a MiServer 3 web page.
Within the Render function, how can I find out the IP address of the browser reading my page?
Thanks
Ray
I have a MiServer 3 web page.
Within the Render function, how can I find out the IP address of the browser reading my page?
Thanks
Ray
Ray Cannon
Please excuse any smelling pisstakes.
Please excuse any smelling pisstakes.
-
ray - Posts: 238
- Joined: Wed Feb 24, 2010 12:24 am
- Location: Blackwater, Camberley. UK
Re: Client IP address in MiServer 3
Note that the specification of MS3 is still subject to change until we make the first official release.
The "request" object that is received as the right argument to the Render function in MiServer 2 is available as a global name under MS3, named _Request. In both versions, this is an object which contains a wealth of information about the request:
The "PeerAddr" property is a 4-element vector containing the IP protocol, a character representation of the address and port number, a numeric vector containing the address (note this will be longer for IPv6) and finally the numeric port number:
The "request" object that is received as the right argument to the Render function in MiServer 2 is available as a global name under MS3, named _Request. In both versions, this is an object which contains a wealth of information about the request:
_Request.⎕nl -2
Arguments Bytes Command Cookies Data Filename Headers Input MSec
Page PeerAddr PeerCert Response RestReq Server Session
_Request.Headers ⍝ For example this property contains the request headers
host localhost:8080
connection keep-alive
cache-control max-age=0
accept text/html,application/xhtml+xml,application/xml...
user-agent Mozilla/5.0 (Windows NT 6.3; WOW64) ...
accept-encoding gzip, deflate...
The "PeerAddr" property is a 4-element vector containing the IP protocol, a character representation of the address and port number, a numeric vector containing the address (note this will be longer for IPv6) and finally the numeric port number:
request.PeerAddr
IPv4 127.0.0.1:51428 127 0 0 1 51428
-
Morten|Dyalog - Posts: 460
- Joined: Tue Sep 09, 2008 3:52 pm
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group