I am making an effort to understand sockets in lua. I am a bit stuck in client:send(data [, i [, j]]) as http://w3.impa.br/~diego/software/luasocket/tcp.html#send provides but I can't quite understand what it actually does and this manual doesn't explain much. For example, in order to send a file request, we use c:send("GET " .. file .. " HTTP/1.0\r\n\r\n"). Why should we use "GET" at the start and "HTTP/1.0\r\n\r\n" at the end? I've searched for other sites but none seem to be informative enough...
Lua socket client:send function
1.7k Views Asked by AudioBubble At
1
There are 1 best solutions below
Related Questions in SOCKETS
- Node.js Server + Socket.IO + Android Mobile Applicatoin XHR Polling Error...?
- My server TCP doesn't receive messages from the client in C
- how is strncpy able to copy from source to empty destination?
- Python Multicast packet receiver stops receiving multicast packets when computer is connected to WiFi
- Python Client-Server Communication with Protocol
- Reversed TLS re-connection issue
- Android 13 & 14 seem to close WebSocket connection, if i put app in background, after ~20s
- Java SocketException: Connection reset,. What is the cause?
- Multipart/form-data with chunked data transfer (ICAP protocol)
- View Socket View
- Client connection timeout during Android & Windows PC communication via sockets
- Browser connect to raw sockets even possible?
- Protocol 43200 after unpacking received data
- Unity SocketIo using Best http2 plugin want to use in webgl
- How does pre-allocating a pool of SocketAsyncEventArgs objects upfront improve the performance of a server application in c#
Related Questions in TCP
- Java SocketException: Connection reset,. What is the cause?
- How does a server handle multiple requests, and how does is know where to send which response?
- How does pre-allocating a pool of SocketAsyncEventArgs objects upfront improve the performance of a server application in c#
- How to peek or ready to check whether HTTP request or not in TCP proxy?
- How does bash > /dev/tcp/"ip"/"port 0<&1 keep its connection alive?
- Python TCP Server that both sends and or receives data (independently) using asyncio streams?
- Can't remotely connect to my postgresql database on digitalocean
- Why my message doesn't write into the socket when I try to read the response after sending it?
- What makes MQTT a raw tcp connection that we can't run it in the browser?
- ImGui rendering wrong characters (characters received from tcp sockets)
- TCP/IP Server Using sockets Java
- C# tcp socket keepalive I want to visit a website, but the specified time is very slow and I cannot access it
- Java TCP socket want to multiple times input with one connection
- How do I receive TCP messages on an android Emulator from a physcal device
- Getting error while using the MessagePattern to communicate between microservices
Related Questions in LUA
- How to make a ServerScript wait for a LocalScript to fire a RemoteEvent
- global const variables in lua 5.4
- Backpack for roblox simulator game
- Calling an event with a delay in Roblox Studio. How to do?
- lghub lua script presskey
- LGHUB Lua script
- In pairs for loop not looping inside of another in pairs loop
- Lua syntax error expected '(' near update_rotation
- 64 unsigned integers in Lua 5.3/5.4 do not behave like in "Programming in Lua"
- How to write a lua pattern that is aware of escaped characters?
- having trouble installing neovim plugin
- Incorrect number comparison result (Lua)
- Lua: is there a need to use hash of string as a key in lua tables
- continuations in lua, is not working while trying extending it
- Neovim Kickstart config "E5113: Error while calling lua chunk: vim/_editor.lua:0: attempt to compare two table values" everytime I open neovim
Related Questions in HTTPREQUEST
- Python Requests: Handling Exceptions and Ensuring Server Response
- Auth0 return status code 400 after on subsequent polls for request token
- How to establish connection pooling for HTTP Requests Lambda function attached to AWS API gateway?
- .NET httpserver. Get handle new request in current request handler
- Struts2 (version 2.5.33) restricts the limit of query string parameters
- ChatWork does not give me access token
- C# Deepl API HTTP Response 403
- How to add parameters when using HttpClient to send request .Net Core C#?
- node-red HTTP authentication through environmental variables
- Http requests with id (put, delete) don't work in ASP.NET Core 8
- Android studio - empty activity won't sync - java.lang.NoClassDefFoundError: org/apache/http/HttpRequest
- Application slowness issue in Chrome
- ASP.NET Core 8 - exclude HTTP request body from logging for certain paths
- The If-Match header contain invalid value
- Post image to Sharepoint List using Http request
Related Questions in HTTP-1.0
- SOAP response get truncated for big payload
- What does this line mean in rfc2068
- Error with reading inputstream of socket in java 1.8
- How to disable HTTP 1.0 protocol in Apache?
- HTTP 1.0 request with HTTPoison
- why between nginx/nginx upstream use http/1.0?
- How to know if a server supports HTTP 1.0
- Java Socket Programming - 301 Error with HTTP 1.1
- What's the most appropriate HTTP status code to return when a client specifies HTTP/1.0 in a websocket opening handshake?
- How does the http get request differ from the https request in c?
- Apache Internal Server Error when posting basic HTTP/1.0 200 OK response in my server? Definitely printing newline
- How many times does a browser connect to a web server when retrieving static content?
- sending image over HTTP1.0 only half of image sent
- Lua socket client:send function
- WSO2 ESB FORCE_HTTP_1.0 not working
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It is all explained in the HTTP 1.0 protocol specifications.
Read specially the request section of the specs:
There are the following methods supported:
SP is separator. CRLF is CR (carriage return) followed by LF (newline feed) characters. The constants are listed here.
So, in a request formed like below:
You have:
GETsome/path/to/file.luaHTTP/1.0\r\nThe characters
\rand\nrespectively represent CR and LF in several programming languages. The are actually the same characters as:string.char(13)andstring.char(10)respectively.