[racket-users] Re: resources for learning JS / React?
This is a good (free) course that takes you the lates best practices of JS (getting more functional), react and then react native. https://www.edx.org/course/cs50s-mobile-app-development-with-react-native On Saturday, January 25, 2020 at 6:56:57 PM UTC, 'John Clements' via users-redirect wrote: > > I have a graduate student that wants a self-guided introduction to JS and > React. The problem here, to some degree, is that there are so *many* > introductions. Does anyone here have specific references that might be > helpful? (Say, e.g., if Gregor Kiczales did a JS course on coursera… that > would be pretty much perfect.) > > John > > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/c433373a-3135-426d-90f3-f5d79032d38c%40googlegroups.com.
Re: [racket-users] Create an identifier in syntax
Hi Ryan, Thank you SO much for that explenation! Everything now clicks!! Sean On Thursday, January 23, 2020 at 4:12:44 PM UTC, Ryan Culpepper wrote: > > On 1/23/20 3:59 PM, Sean Kemplay wrote: > > Hello, > > > > I am exploring macros and am trying to define a variable at the top > > level (with the goal in mind to dynamically define a group of functions > > from a macro). > > > > with-syntax works fine however I was just wondering if it is possible to > > directly inject an identifier as syntax within syntax - something like > > the following which does not work! > > > > (define-syntax x > > (lambda (x) > >#`(define ,#'y "y val"))) > > > > (x) > > y => y: undefined; > > cannot reference an identifier before its definition > > First, to escape a quasisyntax (#`) template you need to use unsyntax > (#,), not unquote (,). > > Second, due to hygiene the y from the macro has an extra scope, so you > can't refer to it by typing y at the top level. But you can do this, for > example: > >(define-syntax (x2 stx) > #`(begin (define #,#'y "y val") y)) > > Or you can write a macro that defines a y with the lexical context of > the macro use: > >(define-syntax (x3 stx) > #`(define #,(datum->syntax stx 'y) "y val")) > > You could also write this macro with with-syntax instead. The way that > you insert an identifier into a syntax template (quasisyntax/unsyntax vs > with-syntax) is independent of the way you create the identifier. > > (Note: using the lexical context of the macro use works here, but it's > not always the right answer. Unhygienic macros are complicated.) > > Ryan > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/ceaef6ec-8bca-428f-af8c-cfb71eddd08f%40googlegroups.com.
[racket-users] Create an identifier in syntax
Hello, I am exploring macros and am trying to define a variable at the top level (with the goal in mind to dynamically define a group of functions from a macro). with-syntax works fine however I was just wondering if it is possible to directly inject an identifier as syntax within syntax - something like the following which does not work! (define-syntax x (lambda (x) #`(define ,#'y "y val"))) (x) y => y: undefined; cannot reference an identifier before its definition this is just to satisfy my own curiosity :-) Cheers, Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/5836fddb-fbc4-464c-87b8-68cff47b69f2%40googlegroups.com.
Re: [racket-users] Abstract run times (HTDP)
Thanks Matthias, I think I have it now, much appreciated. On Friday, May 24, 2019 at 2:24:57 PM UTC+1, Matthias Felleisen wrote: > > > > > On May 24, 2019, at 6:27 AM, Sean Kemplay > wrote: > > > > Hi all, > > > > I trying to work out the ART of the sum-tree question from HTDP2e. > > > > I have worked through the book before however am going through it again, > this time am doing every exercise - this is not homework! > > > > Here is my data defenitions, examples, a function ror summing up the > contents and tests - > > > > ; A Pair is a list of two items > > > > ; A Number-Tree is one of: > > ; Number > > ; [Pair-of Number-Tree] > > ; Examples - > > ; 0 > > ; (list 0 1) > > ; (list (list 1 2) 3) > > ; (list (list 1 2) (list 3 4)) > > ; (list (list (list 1 2) (list 3 4)) (list (list 5 6) (list 7 8))) > > ; (list (list (list (list (list (list (list 8 7) 6 ) 5) 4) 3) 2) 1) > > > > ; Number-Tree -> Number > > ; Sum up all numbers in nt > > (check-expect (sum-list 0) 0) > > (check-expect (sum-list (list 1 2)) 3) > > (check-expect (sum-list (list (list 1 2) (list 3 4))) 10) > > (check-expect (sum-list(list (list (list 1 2) (list 3 4)) (list (list 5 > 6) (list 7 8 36) > > (check-expect (sum-list (list (list (list (list (list (list (list 8 7) 6 > ) 5) 4) 3) 2) 1)) 36) > > (define (sum-list nt) > > (cond [(number? nt) nt] > > [else (+ (sum-list (first nt)) > > (sum-list (second nt)))])) > > > > > > Using a balanced tree my analysis shows an ART of n^2 to run sum-list > where n is the depth of the tree > > (sum-list(list (list (list 1 2) (list 3 4)) (list (list 5 6) (list 7 > 8 > > > > > > Using avery unbalanced tree with all nodesheading down to the left my > analysis shows an ART of 2n - or just n when the constant is removed. > > (sum-list (list (list (list (list (list (list (list 8 7) 6 ) 5) 4) 3) 2) > 1)) > > > > So the unbalanced tree in this case where all nodes need to be visited > would be better? > > > Equally good. > > > > A BST a search function would be better with a balanced tree but not > sum-tree? > > Yes. > > > > Could someone possibly comment whether I am on the right track here? > > Good job. > > > > > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/491b3a19-824b-4e8b-9c2e-7e2f8ff1eabe%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Abstract run times (HTDP)
Hi all, I trying to work out the ART of the sum-tree question from HTDP2e. I have worked through the book before however am going through it again, this time am doing every exercise - this is not homework! Here is my data defenitions, examples, a function ror summing up the contents and tests - ; A Pair is a list of two items ; A Number-Tree is one of: ; Number ; [Pair-of Number-Tree] ; Examples - ; 0 ; (list 0 1) ; (list (list 1 2) 3) ; (list (list 1 2) (list 3 4)) ; (list (list (list 1 2) (list 3 4)) (list (list 5 6) (list 7 8))) ; (list (list (list (list (list (list (list 8 7) 6 ) 5) 4) 3) 2) 1) ; Number-Tree -> Number ; Sum up all numbers in nt (check-expect (sum-list 0) 0) (check-expect (sum-list (list 1 2)) 3) (check-expect (sum-list (list (list 1 2) (list 3 4))) 10) (check-expect (sum-list(list (list (list 1 2) (list 3 4)) (list (list 5 6) (list 7 8 36) (check-expect (sum-list (list (list (list (list (list (list (list 8 7) 6 ) 5) 4) 3) 2) 1)) 36) (define (sum-list nt) (cond [(number? nt) nt] [else (+ (sum-list (first nt)) (sum-list (second nt)))])) Using a balanced tree my analysis shows an ART of n^2 to run sum-list where n is the depth of the tree (sum-list(list (list (list 1 2) (list 3 4)) (list (list 5 6) (list 7 8 Using avery unbalanced tree with all nodesheading down to the left my analysis shows an ART of 2n - or just n when the constant is removed. (sum-list (list (list (list (list (list (list (list 8 7) 6 ) 5) 4) 3) 2) 1)) So the unbalanced tree in this case where all nodes need to be visited would be better? A BST a search function would be better with a balanced tree but not sum-tree? Could someone possibly comment whether I am on the right track here? Kind regards, Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/4210ccdc-9d9e-434a-8dab-12b3d7b424d0%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] lists.racket-lang.org seems to be down
H All, Just reporting that https://lists.racket-lang.org/ seems to be down. I have tried on both my laptop and phone. Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Subproceses in Windows
Thanks George, that explains it perfectly. On Monday, November 5, 2018 at 5:11:04 PM UTC, gneuner2 wrote: > > > > On 11/5/2018 11:49 AM, Sean Kemplay wrote: > > Hi All, > > I am trying to open windoes explorer from Racket using the following - > > (system* "cmd" "start" "explorer.exe") > > However it is not working and #f is being returned. This works fine from > Go and even VBScript! > > Anyone know what I am missing? > > Kind regards, > Sean > > > > On Windows the path isn't searched (for whatever reason). You need to do > something like: > > (let [ > (path (find-executable-path "explorer.exe")) > ] > (system* path) > ) > > > George > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Subproceses in Windows
Hi All, I am trying to open windoes explorer from Racket using the following - (system* "cmd" "start" "explorer.exe") However it is not working and #f is being returned. This works fine from Go and even VBScript! Anyone know what I am missing? Kind regards, Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Webserver HTTP 2
Hello, Does anyone know if the Racket webserver will support http2 at any stage? Kind regards, Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] [Library Announcement] CSS-expressions, Pollen Component and Extensible Functions
I will definitely check out the CSS package this weekend! On 13 Feb 2017 13:48, "Leandro Facchinetti"wrote: > Hi all, > > I’m here to announce three packages I published recently, because I want > feedback from the community: > > - CSS-expressions: S-expression-based CSS. > https://docs.racket-lang.org/css-expr/index.html > > - Pollen Component: Component-based development for Pollen. > https://docs.racket-lang.org/pollen-component/index.html > > - Extensible Functions: A solution to the expression problem in Typed > Racket. > https://docs.racket-lang.org/extensible-functions/index.html > > Thank you. > -- > Leandro Facchinetti > https://www.leafac.com > GPG: 0x5925D0683DF3D583 > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Safely using port->string where nothing has been written to the port
Hi David, Indeed it does!! Thanks for your help. Sean On Monday, January 23, 2017 at 7:16:58 PM UTC, David K. Storrs wrote: > Hi Sean, > > Does (byte-ready?) work for your case? > > https://docs.racket-lang.org/reference/Byte_and_String_Input.html?q=peek#%28def._%28%28quote._~23~25kernel%29._byte-ready~3f%29%29 > > > > On Mon, Jan 23, 2017 at 6:05 AM, Sean Kemplay <sean.k...@gmail.com> wrote: > Hello, > > > > I am using the URL library to interact with a REST API. > > > > One of the Endpoints sends returns no content for a POST request with a > status code of 204 (a little unusual however it is an external API so we have > to cater to it). > > > > I can check the status code for 204 and only apply string->port if it isn't a > 204 - however I was wondering if there is any check that can be made at the > port level that no content will be written - in case we encounter a malformed > response which does not send through a body. > > > > Currently without the checks port->string will hang on a 204 response. > > > > This would be good to know more generally when dealing with ports as well. > > > > Kind regards, > > Sean > > > > -- > > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users...@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Safely using port->string where nothing has been written to the port
Hello, I am using the URL library to interact with a REST API. One of the Endpoints sends returns no content for a POST request with a status code of 204 (a little unusual however it is an external API so we have to cater to it). I can check the status code for 204 and only apply string->port if it isn't a 204 - however I was wondering if there is any check that can be made at the port level that no content will be written - in case we encounter a malformed response which does not send through a body. Currently without the checks port->string will hang on a 204 response. This would be good to know more generally when dealing with ports as well. Kind regards, Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Testing an HTTPS (over HTTP CONECT) proxy
Hi Tim, This is great, the whole proxy thing has been an issue for me as well - I took a stab at doing something like this last year but couldn't get it working. I have access to a trend and scansafe proxy so can physically test against those if you want. Kind regards, Sean On Tuesday, August 9, 2016 at 2:37:03 PM UTC+1, Jay McCarthy wrote: > Here are some testing options: > 1) Implement a proxy server in Racket > > 2) Fake a proxy server that just repeats what you know to be a good > session (by dumping an interaction with a real server) > > 3) Require squid or something to be present when testing > > 4) Find a public proxy server that can be used to test > > -- > > I recommend 2. > > Jay > > On Tue, Aug 9, 2016 at 9:28 AM, Tim Brownwrote: > > Folks, > > > > Fed up with not being able to install racket (or generally use raco) from > > behind > > a firewall, I have a PR https://github.com/racket/racket/pull/1411 open > > which allows > > me to use HTTPS over an HTTP CONNECT (e.g. squid) proxy. > > > > I need to document and test my changes. > > > > Documentation is a straightforward enough exercise. > > > > However, I’m a bit stuck with testing. I have a new clone of > > tim-brown/racket > > and a `make` is building, DOWNLOADING and INSTALLING the packages. The > > capitals > > are because I am so excited! So, as far as I can tell: it “works for me”. > > > > I guess that isn’t what most engineers would call a test-suite, however. > > Since the code deals with proxy servers -- which are an > > installation-specific > > thing. I can write tests like the ones in pkgs/net-test/tests/net/url.rkt > > -- which > > test parsing proxy server names. But there is nothing to make sure that > > proxying > > connections works. > > > > I was wondering if anyone has suggestions for writing tests for this. > > > > Tim > > > > PS: The make is no longer building. > > It is fully builded! > > > > -- > > Tim Brown CEng MBCS > > > > City Computing Limited · www.cityc.co.uk > > City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB > > T:+44 20 8770 2110 · F:+44 20 8770 2130 > > > > City Computing Limited registered in London No:1767817. > > Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE > > VAT No: GB 918 4680 96 > > > > -- > > You received this message because you are subscribed to the Google Groups > > "Racket Users" group. > > To unsubscribe from this group and stop receiving emails from it, send an > > email to racket-users+unsubscr...@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > > > -- > Jay McCarthy > Associate Professor > PLT @ CS @ UMass Lowell > http://jeapostrophe.github.io > >"Wherefore, be not weary in well-doing, > for ye are laying the foundation of a great work. > And out of small things proceedeth that which is great." > - D 64:33 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Transforming data for plot / discreet-histogram
Hello, Something like the following would be ideal to build a histogram from a sequence of values read in via CSV #lang racket (require math) (require plot) (discrete-histogram (samples->hash '(1 2 3 4 4))) However discreet histogram takes a list of vectors. Is there a way to achieve something like the above without managing a list of vectors for 500,000+ rows of data? Reading the docs, I thought discrete-histogram would also take a list of lists and that I could do something like (discrete-histogram (hash->list (samples->hash '(1 2 3 4 4 but it looks like hash->list returns a list of dotted pairs. Sorry, I dip in and out of Racket so I may be missing something obvious. Maybe run through hash-map? Kind regards, Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Web-server multi core
Hi all, There have been multiple queries about utilising multiple cores with Racket's webserver and also some ideas put forward by Jay and others. Has anyone got something working they would be willing to share? I am really hoping to use racket over clojure for a new project but making use of all server CPU cores is important. Kind regards, Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Nested HTML templates
Hello, Has anyone had any experience using web-server/template? If so do you have any suggestions on how to best/compose so there is a base template with placeholders being filled by other templates (which could in turn have even deeper nesting themselves)? Kind regards, Sean -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] Re: raco pkg install behind proxy
Hi Tim, The net/http-client library (last time I looked) does not currently support SSL tunneling which would be required for ssl connections through a proxy such as squid. net/url builds on net/http-client and also does not have that support. Link to what Squid has to say about tunneling - http://wiki.squid-cache.org/Features/HTTPS I was looking into SSL tunneling myself a few months ago and got partway there but it is on the backburner at the moment. If it were to be baked into net/http-client though, everything else would benefit. Kind regards, Sean On Friday, October 9, 2015 at 2:39:26 PM UTC+1, Tim Brown wrote: > Folks, > > I have created a package, which needs to be deployed locally behind a > Squid HTTP proxy. > > My info.rkt has: > (define deps > (list > "db-lib" > "web-server-lib" > ...)) > > I want to keep my racket installation as minimal as possible. > > My initial problem comes because raco doesn’t honour any proxy settings > (in .racketrc, or in the environment). That means that I don’t even get > off my network. > > I tweaked net/url.rkt with some hard-coded proxies (subject of another > email): > > (define current-proxy-servers > (make-parameter '(("http" "proxyname" 3128) > ("https" "proxyname" 3128)) ...)) > > This then got me the following error: > > ssl-connect: connect failed (error:140770FC:SSL > routines:SSL23_GET_SERVER_HELLO:unknown protocol) > > I’m stumped as to how I resolve this, since I don’t know where this is > thrown up from -- squid, openssl, mzssl, git, what? > > Can anyone help me out here? > > Full transcript of woe below the dotted line. > > Tim > > . (dotted line) > > PLTSTDERR=debug@net/url minimal-racket/bin/raco pkg install >--fail-fast -i mypackage.tgz > > The following uninstalled packages are listed as dependencies of > mypackage: >db-lib >web-server-lib >... > Would you like to install these dependencies? [Y/n/a/c/?] Y > > 00: Resolving "db-lib" via http://pkgs.racket-lang.org > tcp-connect: connection failed > detail: host not found > address: pkgs.racket-lang.org > port number: 80 > step: 1 > system error: Name or service not known; errno=-2 > context...: > .../minimal-racket/share/racket/collects/net/http-client.rkt:224:0 > .../minimal-racket/share/racket/collects/racket/contract/private/arrow-val-first.rkt:324:3 > .../minimal-racket/share/racket/collects/net/url.rkt:77:0: > http://getpost-impure-port > .../minimal-racket/share/racket/collects/net/url.rkt:179:2: redirection-loop > .../minimal-racket/share/racket/collects/racket/contract/private/arrow-val-first.rkt:324:3 > .../minimal-racket/share/racket/collects/pkg/private/network.rkt:58:3 > > > I can circumvent this by hard-coding some proxy-servers into > current-proxy-servers in net/url.rkt, and repeat the exercise: > 00: Resolving "db-lib" via http://pkgs.racket-lang.org > Downloading repository git://github.com/racket/db/?path=db-lib > ssl-connect: connect failed (error:140770FC:SSL > routines:SSL23_GET_SERVER_HELLO:unknown protocol) > context...: > .../minimal-racket/share/racket/collects/openssl/mzssl.rkt:1401:8: loop > .../minimal-racket/share/racket/collects/openssl/..:261:28 > .../minimal-racket/share/racket/collects/openssl/..:259:25 > .../minimal-racket/share/racket/collects/net/http-client.rkt:224:0 > .../minimal-racket/share/racket/collects/racket/contract/private/arrow-val-first.rkt:324:3 > .../minimal-racket/share/racket/collects/net/url.rkt:77:0: > http://getpost-impure-port > .../minimal-racket/share/racket/collects/net/url.rkt:179:2: redirection-loop > .../minimal-racket/share/racket/collects/racket/contract/private/arrow-val-first.rkt:324:3 > .../minimal-racket/share/racket/collects/net/git-checkout.rkt:204:0: > initial-connect > .../minimal-racket/share/racket/collects/net/git-checkout.rkt:40:2: > retry-loop > .../minimal-racket/share/racket/collects/pkg/private/download.rkt:101:2: > download! > .../minimal-racket/share/racket/collects/file/cache.rkt:63:2: > fetch-and-continue > .../minimal-racket/share/racket/collects/racket/contract/private/arrow-val-first.rkt:324:3 > .../minimal-racket/share/racket/collects/pkg/private/download.rkt:93:0: > download-repo!24 > .../minimal-racket/share/racket/collects/pkg/private/stage.rkt:299:11 > > -- > Tim Brown CEng MBCS > > City Computing Limited · www.cityc.co.uk > City House · Sutton Park Rd · Sutton · Surrey · SM1 2AE · GB > T:+44 20 8770 2110 · F:+44 20 8770 2130 > > City Computing Limited registered in London No:1767817. > Registered Office: City House, Sutton Park Road, Sutton, Surrey, SM1 2AE > VAT No: GB 918 4680 96 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from
Re: [racket-users] HTTPS connection through proxy (CONNECT HTTP Method)
On Wednesday, August 12, 2015 at 9:54:23 PM UTC+1, Sean Kemplay wrote: On Wednesday, August 12, 2015 at 12:54:10 PM UTC+1, Jay McCarthy wrote: On Tue, Aug 11, 2015 at 10:24 AM, Sean Kemplay sean.kemp...@gmail.com wrote: Hi All, Sending an http request through our corporate proxy works as follows for http requests - (define-values (x y z) (http-sendrecv 10.0.0.200 http://www.example.com; #:port 8080 #:headers '( Proxy-Authorization: Basic base64encodedcredentials Proxy-Connections: keep-alive ) #:ssl? #f #:method GET)) However fails for HTTPS requests (as expected). What I need to do is make a request like the above using the #:method CONNECT and then make a secondary request through a returned connection. Does anyone know how I would go about doing that in Racket? http-sendrecv combines calls to http-conn-open, http-conn-send!, http-conn-recv!, then http-conn-close!. I suspect that you just need to break up that one big call into a few calls like open, send, recv, send, recv, close. I'd be happy to work on it with you, but I don't have such a proxy on hand, so I'll need helping testing it. Jay Kind regards, Sean -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Jay McCarthy http://jeapostrophe.github.io Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great. - DC 64:33 Hi Jay, Thanks for that, yes I think you are right. I have just installed squid at home which also supports http tunnelling. I'll see how I get on and post my results - whether they be good or bad! It would be really good to at least get an example on the wiki for others to build from, as I suspect a lot of corporate networks are behind proxies and this would be problematic in using Racket to make calls to REST APIs etc which my job at least requires a lot of. Kind regards, Sean Hi Jay, Unfortunately I am not getting very far with this. Our app servers where our production code sits are not behind a proxy, so at the end of the day it doesn't rule out using Racket for some of the tasks I have in mind. It would be nice to be able to get through the proxy from my desktop to test code though. I tried the following but the connection is ending early - #lang racket (require net/http-client) (define conn (http-conn-open 10.0.0.200 #:port 8080)) (http-conn-send! conn https://news.ycombinator.com/; #:method CONNECT #:headers '(Proxy-Authorization: Basic base64encodedcredentials Connection: Keep-Alive) #:version #1.1) (define-values (a b c)(http-conn-recv! conn #:close? #f)) (http-conn-send! conn / #:method GET); #:headers '(Proxy-Authorization: Basic Y3hnXHNlYW4ua2VtcGxheTpBdWd1c3QyMDE0 Connection: Keep-Alive) #:version #1.1) (define-values (e f g) (http-conn-recv! conn)) (http-conn-close! conn) I am basing the above on this S/O post but am not entirely sure if this is even the path I should be pursuing! http://stackoverflow.com/questions/11697943/when-should-one-use-connect-and-get-http-methods-at-http-proxy-server Here is an example using Node, it opens the connection to the uri through the proxy, then writes to that connection through an SSL connection which is something I can't see how to do in Racket. http://blog.vanamco.com/proxy-requests-in-node-js/ I will keep digging, if you have any Ideas or anything I could test against our network it would be much appreciated. Kind regards, Sean -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] HTTPS connection through proxy (CONNECT HTTP Method)
On Friday, August 14, 2015 at 10:22:03 AM UTC+1, Sean Kemplay wrote: On Wednesday, August 12, 2015 at 9:54:23 PM UTC+1, Sean Kemplay wrote: On Wednesday, August 12, 2015 at 12:54:10 PM UTC+1, Jay McCarthy wrote: On Tue, Aug 11, 2015 at 10:24 AM, Sean Kemplay sean.kemp...@gmail.com wrote: Hi All, Sending an http request through our corporate proxy works as follows for http requests - (define-values (x y z) (http-sendrecv 10.0.0.200 http://www.example.com; #:port 8080 #:headers '( Proxy-Authorization: Basic base64encodedcredentials Proxy-Connections: keep-alive ) #:ssl? #f #:method GET)) However fails for HTTPS requests (as expected). What I need to do is make a request like the above using the #:method CONNECT and then make a secondary request through a returned connection. Does anyone know how I would go about doing that in Racket? http-sendrecv combines calls to http-conn-open, http-conn-send!, http-conn-recv!, then http-conn-close!. I suspect that you just need to break up that one big call into a few calls like open, send, recv, send, recv, close. I'd be happy to work on it with you, but I don't have such a proxy on hand, so I'll need helping testing it. Jay Kind regards, Sean -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Jay McCarthy http://jeapostrophe.github.io Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great. - DC 64:33 Hi Jay, Thanks for that, yes I think you are right. I have just installed squid at home which also supports http tunnelling. I'll see how I get on and post my results - whether they be good or bad! It would be really good to at least get an example on the wiki for others to build from, as I suspect a lot of corporate networks are behind proxies and this would be problematic in using Racket to make calls to REST APIs etc which my job at least requires a lot of. Kind regards, Sean Hi Jay, Unfortunately I am not getting very far with this. Our app servers where our production code sits are not behind a proxy, so at the end of the day it doesn't rule out using Racket for some of the tasks I have in mind. It would be nice to be able to get through the proxy from my desktop to test code though. I tried the following but the connection is ending early - #lang racket (require net/http-client) (define conn (http-conn-open 10.0.0.200 #:port 8080)) (http-conn-send! conn https://news.ycombinator.com/; #:method CONNECT #:headers '(Proxy-Authorization: Basic base64encodedcredentials Connection: Keep-Alive) #:version #1.1) (define-values (a b c)(http-conn-recv! conn #:close? #f)) (http-conn-send! conn / #:method GET); #:headers '(Proxy-Authorization: Basic Y3hnXHNlYW4ua2VtcGxheTpBdWd1c3QyMDE0 Connection: Keep-Alive) #:version #1.1) (define-values (e f g) (http-conn-recv! conn)) (http-conn-close! conn) I am basing the above on this S/O post but am not entirely sure if this is even the path I should be pursuing! http://stackoverflow.com/questions/11697943/when-should-one-use-connect-and-get-http-methods-at-http-proxy-server Here is an example using Node, it opens the connection to the uri through the proxy, then writes to that connection through an SSL connection which is something I can't see how to do in Racket. http://blog.vanamco.com/proxy-requests-in-node-js/ I will keep digging, if you have any Ideas or anything I could test against our network it would be much appreciated. Kind regards, Sean Just an update on this, looking at the code for http-client I now understand that http-conn is a struct with an input and output port from a tcp connection. Based on the node.js example I am thinking of instead of calling http-conn-send! a second time with a different method I need to write a function along the lines of http-conn-tunnel! which somehow pipes ssl input and output ports from the tcp input and output ports from http-conn's input and output pipes. -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https
Re: [racket-users] HTTPS connection through proxy (CONNECT HTTP Method)
On Friday, August 14, 2015 at 3:41:04 PM UTC+1, Sean Kemplay wrote: On Friday, August 14, 2015 at 10:22:03 AM UTC+1, Sean Kemplay wrote: On Wednesday, August 12, 2015 at 9:54:23 PM UTC+1, Sean Kemplay wrote: On Wednesday, August 12, 2015 at 12:54:10 PM UTC+1, Jay McCarthy wrote: On Tue, Aug 11, 2015 at 10:24 AM, Sean Kemplay sean.kemp...@gmail.com wrote: Hi All, Sending an http request through our corporate proxy works as follows for http requests - (define-values (x y z) (http-sendrecv 10.0.0.200 http://www.example.com; #:port 8080 #:headers '( Proxy-Authorization: Basic base64encodedcredentials Proxy-Connections: keep-alive ) #:ssl? #f #:method GET)) However fails for HTTPS requests (as expected). What I need to do is make a request like the above using the #:method CONNECT and then make a secondary request through a returned connection. Does anyone know how I would go about doing that in Racket? http-sendrecv combines calls to http-conn-open, http-conn-send!, http-conn-recv!, then http-conn-close!. I suspect that you just need to break up that one big call into a few calls like open, send, recv, send, recv, close. I'd be happy to work on it with you, but I don't have such a proxy on hand, so I'll need helping testing it. Jay Kind regards, Sean -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Jay McCarthy http://jeapostrophe.github.io Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great. - DC 64:33 Hi Jay, Thanks for that, yes I think you are right. I have just installed squid at home which also supports http tunnelling. I'll see how I get on and post my results - whether they be good or bad! It would be really good to at least get an example on the wiki for others to build from, as I suspect a lot of corporate networks are behind proxies and this would be problematic in using Racket to make calls to REST APIs etc which my job at least requires a lot of. Kind regards, Sean Hi Jay, Unfortunately I am not getting very far with this. Our app servers where our production code sits are not behind a proxy, so at the end of the day it doesn't rule out using Racket for some of the tasks I have in mind. It would be nice to be able to get through the proxy from my desktop to test code though. I tried the following but the connection is ending early - #lang racket (require net/http-client) (define conn (http-conn-open 10.0.0.200 #:port 8080)) (http-conn-send! conn https://news.ycombinator.com/; #:method CONNECT #:headers '(Proxy-Authorization: Basic base64encodedcredentials Connection: Keep-Alive) #:version #1.1) (define-values (a b c)(http-conn-recv! conn #:close? #f)) (http-conn-send! conn / #:method GET); #:headers '(Proxy-Authorization: Basic Y3hnXHNlYW4ua2VtcGxheTpBdWd1c3QyMDE0 Connection: Keep-Alive) #:version #1.1) (define-values (e f g) (http-conn-recv! conn)) (http-conn-close! conn) I am basing the above on this S/O post but am not entirely sure if this is even the path I should be pursuing! http://stackoverflow.com/questions/11697943/when-should-one-use-connect-and-get-http-methods-at-http-proxy-server Here is an example using Node, it opens the connection to the uri through the proxy, then writes to that connection through an SSL connection which is something I can't see how to do in Racket. http://blog.vanamco.com/proxy-requests-in-node-js/ I will keep digging, if you have any Ideas or anything I could test against our network it would be much appreciated. Kind regards, Sean Just an update on this, looking at the code for http-client I now understand that http-conn is a struct with an input and output port from a tcp connection. Based on the node.js example I am thinking of instead of calling http-conn-send! a second time with a different method I need to write a function along the lines of http-conn-tunnel! which somehow pipes ssl input and output ports from the tcp input and output ports from http-conn's input and output pipes. I haven't given up... yet! I exported http-conn-from and http-conn
Re: [racket-users] HTTPS connection through proxy (CONNECT HTTP Method)
On Wednesday, August 12, 2015 at 12:54:10 PM UTC+1, Jay McCarthy wrote: On Tue, Aug 11, 2015 at 10:24 AM, Sean Kemplay sean.kemp...@gmail.com wrote: Hi All, Sending an http request through our corporate proxy works as follows for http requests - (define-values (x y z) (http-sendrecv 10.0.0.200 http://www.example.com; #:port 8080 #:headers '( Proxy-Authorization: Basic base64encodedcredentials Proxy-Connections: keep-alive ) #:ssl? #f #:method GET)) However fails for HTTPS requests (as expected). What I need to do is make a request like the above using the #:method CONNECT and then make a secondary request through a returned connection. Does anyone know how I would go about doing that in Racket? http-sendrecv combines calls to http-conn-open, http-conn-send!, http-conn-recv!, then http-conn-close!. I suspect that you just need to break up that one big call into a few calls like open, send, recv, send, recv, close. I'd be happy to work on it with you, but I don't have such a proxy on hand, so I'll need helping testing it. Jay Kind regards, Sean -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. -- Jay McCarthy http://jeapostrophe.github.io Wherefore, be not weary in well-doing, for ye are laying the foundation of a great work. And out of small things proceedeth that which is great. - DC 64:33 Hi Jay, Thanks for that, yes I think you are right. I have just installed squid at home which also supports http tunnelling. I'll see how I get on and post my results - whether they be good or bad! It would be really good to at least get an example on the wiki for others to build from, as I suspect a lot of corporate networks are behind proxies and this would be problematic in using Racket to make calls to REST APIs etc which my job at least requires a lot of. Kind regards, Sean -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
[racket-users] HTTPS connection through proxy (CONNECT HTTP Method)
Hi All, Sending an http request through our corporate proxy works as follows for http requests - (define-values (x y z) (http-sendrecv 10.0.0.200 http://www.example.com; #:port 8080 #:headers '( Proxy-Authorization: Basic base64encodedcredentials Proxy-Connections: keep-alive ) #:ssl? #f #:method GET)) However fails for HTTPS requests (as expected). What I need to do is make a request like the above using the #:method CONNECT and then make a secondary request through a returned connection. Does anyone know how I would go about doing that in Racket? Kind regards, Sean -- You received this message because you are subscribed to the Google Groups Racket Users group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.