Is there a library to work with this files in golang? [closed] - go

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed last month.
Improve this question
I was looking for information about .sock files and what is the unix: at the beginning of this type of file. For example in the nginx configuration files you can find this:
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
And according to what I found on the internet they are called unix pipes, if I'm wrong please correct me, now that I've explained what I mean. Is there a library in golang to deal with this kind of files? I've been searching the internet and found very little information about it. Or is it possible to handle this kind of files in golang? It would be a good idea?

"unix domain socket" is not a file format, it is a construct handled by your system.
You interact with them much like you would interact with a tcp socket :
a server can listen on it (using net.Listen("unix", ...)),
a client can connect to it (using net.Dial("unix", ...)),
and then both can exchange messages using Read/Write.
See this question for a basic example of how to use them.
The format of the messages exchanged over this socket is hinted at by the fastcgi_pass part of your config line : fastcgi is a network protocol (wikipedia link) which describes how requests and responses should be exchanged.
Look for a golang library for "fastcgi server" or "fastcgi client" (I couldn't make out what side you are looking for from your question, I guess it would be a client ?).

Related

WebSocket compatibility with GopherJS [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
Looking for some general guidance on how to implement a WebSocket client in a way that works on both native Go execution platforms and through GopherJS.
It appears that GopherJS has two WebSocket libraries, one at gopherjs/websocket and one at goxjs/websocket. It seems that goxjs/websocket is "isomorphic", meaning it should work in GopherJS while remaining API-compatible with golang.org/x/net/websocket. That would provide compatibility in both execution environments, which is fine, but I'm not sure if it's the best solution. gopherjs/websocket doesn't appear to work outside of the browser execution environment, so it's a non-starter.
The most recommended WebSocket implementation for native Go apps seems to be gorilla/websocket at the moment. I'd like to use this as it seems to have a good API and it seems rather fully-featured. I can successfully run gopherjs build if I import gorilla/websocket, but I'm concerned that it will fail in the JavaScript environment, or that it will be compiled down into JavaScript that doesn't use the browser's implementation of the WebSocket API.
I'm not seeing much guidance on which library is appropriate for which scenario, so hoping this can help compare and contrast and provide the direction necessary to make a good choice.
I don't have any guidance on what you should do, but can share these facts:
The gorilla/websocket package is an implementation of the Websocket protocol on TCP connections. Because browser applications cannot access TCP connections directly, the gorilla/websocket package will not run in the browser.
There's a difference in the models presented by gorilla/websocket package and the gopherjs/websocket packages. The WebSocket protocol is message-based and the gorilla/websocket package exposes an API around messages. The gopherjs/websocket provides bindings that make the message-based WebSocket protocol look like a stream of bytes. Messages are not exposed in the gopherjs/websocket API.
The x/net/websocket package is all but abandoned. There are long standing issues with protocol compliance that have not been addressed.

Golang websocket client [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 2 years ago.
Improve this question
I want to make client websocket connections to exertnal server each connection = goroutine and reader. I was looking informations on the internet but I found how to create server websocket tutorials.
Can anyone be so kind and make a trivial example and walk me through. I am using standart golang libary https://golang.org/x/net/websocket.
I created some code but when I closed one connection program exited with EOF information. I won't post the code because it's probably bad duo to the fact it was my first try.
I know how to read/send message from websocket but I don't know how to create multiple connections.
Any informations, examples would be appreciate, thanks for reading
You can use the Gorilla WebSocket library
Here's an example of it's use as a client
Golang official doc recommends to use gorilla for building websocket based application. Still the problem is, gorilla websocket is not event based. Applications need to handle concurrent read and write operations. Developers need to write custom goroutines for handling connect, disconnect and read events.
I think it is better to have a library handling everything for you.
So, I decided to write down my own client implementation - gowebsocket on top of gorilla. You can find more detailed explaination here Getting started with websocket client in go
You can check the comparison given on this link.
https://yalantis.com/uploads/ckeditor/pictures/4265/websocket-libraries.png
Article suggests to go for Gobwas(https://github.com/gobwas/ws). Its best performance wise and offers all the required features needed for websockets related applications.

Graphical HTTP client for windows [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
I am looking for a Windows graphical utility for performing HTTP operations.
For example, I want to be able to say things like:
POST to http://example.org/test/service
With a POST body: "Data goes here"
Does anyone know a good piece of software for doing this?
I too have been frustrated by the lack of good graphical http clients available for Windows. So over the past couple years I've been developing one myself: I'm Only Resting, "a feature-rich WinForms-based HTTP client." It's open source (Apache License, Version 2.0) with freely available downloads.
It currently has fairly complete coverage of HTTP features except for file uploads, and it provides a very good user interface with great request and response management.
Here's a screenshot:
Update: For people that still come across this, Postman is your best bet now: https://www.getpostman.com/apps
RestClient is my favorite. It's Java based. I think it should meet your needs quite nicely. I particularly like the Auth suppport.
https://github.com/wiztools/rest-client
Have you looked at Fiddler 2 from Microsoft?
http://www.fiddler2.com/fiddler2/
Allows you to generate most types of request for testing, including POST. It also supports capturing HTTP requests made by other applications and reusing those for testing.
You can use Microsoft's WFetch tool also. This is a good tool for all HTTP operations.
You could try Jsonium tool http://jsonium.org- nice free tool specialized on requests with JSON in bodies and responses
http://www.ieinspector.com/httpanalyzer/
http://www.microsoft.com/downloads/details.aspx?FamilyID=B134A806-D50E-4664-8348-DA5C17129210&displaylang=en
https://addons.mozilla.org/en-US/firefox/addon/9780/
http://soft-net.net/SendHTTPTool.aspx
https://addons.mozilla.org/en-US/firefox/addon/966/
Honestly, for simplistic stuff like that I typically whip up a quick HTML form in a local file and load that up in a browser.
I like rest-client a lot for the purposes you described. It's a Java application to test REST-based web services.
If anybody is still interest Eclipse Labs Rest Client tool is an excellent choice. I'm trying it in Windows in an EXE version and works smoothly.
I've worked also with Rest Client previously and its great too.
https://play.google.com/store/apps/details?id=com.snmba.restclient
works from Android Tablets & Phones. Flexible enough to try various combinations.

What HTTP traffic monitor would you recommend for Windows? [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
I need the sniffer to test network traffic of applications developed by me for Windows and Facebook.
Basic requirements:
display request and response
display HTTP headers
display the time it took to complete HTTP request
Now I'm using HTTP Analyzer.
A very good tool, but it terminates with some error after 10-15 min running on Vista.
Wireshark if you want to see everything going on in the network.
Fiddler if you want to just monitor HTTP/s traffic.
Live HTTP Headers if you're in Firefox and want a quick plugin just to see the headers.
Also FireBug can get you that information too and provides a nice interface when your working on a single page during development. I've used it to monitor AJAX transactions.
I now use CharlesProxy for development, but previously I have used Fiddler
Try Wireshark:
Wireshark is the world's foremost
network protocol analyzer, and is the
de facto (and often de jure) standard
across many industries and educational
institutions.
There is a bit of a learning curve but it is far and away the best tool available.
Microsoft Network Monitor (http://www.microsoft.com/downloads/details.aspx?FamilyID=983b941d-06cb-4658-b7f6-3088333d062f)
Fiddler is great when you are only interested in the http(s) side of the communications. It is also very useful when you are trying to inspect inside a https stream.
I like TcpCatcher because it is very simple to use and has a modern interface. It is provided as a jar file, you just download it and run it (no installation process). Also, it comes with a very useful "on the fly" packets modification features (debug mode).
I use Wireshark in most cases, but I have found Fiddler to be less of a hassle when dealing with encrypted data.

Upload File Directly to S3 with Progress Bar [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 8 years ago.
Improve this question
Relating to this question, Upload files directly to Amazon S3 from ASP.NET application, is there any way to do this and have a progress bar?
---- EDIT ----
Two days later and still no luck with a direct way. Found one thing that looks promising but not free: http://www.flajaxian.com/
Uses flash to upload directly to S3 with a progress bar.
I'm looking for a solution as well. Maybe this will be of some help,
From AWS Dev Commnity
But in many languages (PHP, Java), for
big files, you have to use streams
through which the language environment
will take chunks of your big file one
after the other (in order to fill up
central memory with huge amount of
data for the http POST of S3 needed
for the upload.
The nice thing about stream is that
they have a callback called whenever
the next chunk is read for to further
PUT (in the https sense) data to S3.
You can use this callback to compute
and display the progress on the client
UI.
See the doc of libcurl to see in
details how all this works.
Update: It looks like there are two straightforward options.
Flash, via the FileReference class
With a Java applet
I personally hate using 3rd party extensions (Flash, Java) to make an app function, but I haven't found another way.
html5 javascript can allow you to do it, if you don't mind lack of browser support (Firefox and Chrome only as of this post_
Example here: https://developer.mozilla.org/en/Using_files_from_web_applications
This isn't specific to AWS, but may help you get closer.
Another approach is to use something like Uber Uploader (http://uber-uploader.sourceforge.net/) which is a perl / php hybrid solution with a progress bar. You would simply upload the files to your server and then have your server FTP them in the background to the final destination. It is an extra step but it gives you some time to do any processing / encoding / etc. that you may need to do before sending to S3.

Resources