Comments (8)
This is a nice idea, thanks!
Functionality to support this has been added in:
You can now upload as below:
# Pipe in some output from any command
> echo "Hello world" | nc nc.pastes.dev 1337
# Upload the contents of a file
> cat example123.txt | nc nc.pastes.dev 1337
Bit of a childish port number but I thought it'd be easier to remember 😛
See https://github.com/lucko/paste-netcat/ for more info on the implementation. I thought it was better to have a separate service that handles the netcat connections and proxies them to the normal HTTP storage API (bytebin). You could even standup your own instance of paste-netcat (e.g. inside a firewall) but still proxy out to the pastes.dev service.
In theory it supports the same content size limits as bytebin - currently configured to a max of 10mb post-gzip. The paste-netcat server handles compression before forwarding the request on. All of which means it should be able to handle reasonably large plaintext files with no issue.
I've also updated the readme with this info :)
Thanks again!
from paste.
Hm, nc.pastes.dev doesn't seem to be working for me?
/tmp/server via ☕ v17.0.1
❯ cat paper.yml | nc nc.pastes.dev 1337
/tmp/server via ☕ v17.0.1 took 30s
❯
from paste.
Ah! I was testing with netcat on macOS, which has some subtle differences compared with other versions (e.g. on Linux machines)
Should be fixed by lucko/paste-netcat@8673ada :)
Let me know if that works
from paste.
Works! Another suggestion would be to add the ability to specify a language for syntax highlighting until there's some auto detection.
e.g. netcat to nc.pastes.dev/yaml for YAML
from paste.
Sweet!
Unfortunately netcat only works with hostnames & ports, not URLs - that's a HTTP thing.
Only options are:
- more subdomains (bit of a pain)
- more ports (hard to remember)
- some sort of header in the submitted content - but at that point you're better off using curl
echo "test: 123" | curl -d @- -H 'Content-Type: text/yaml' https://api.pastes.dev/post
Auto-detection is also a bit tricky, but I'll elaborate more on that another time, on the other issue.
from paste.
Sweet!
Unfortunately netcat only works with hostnames & ports, not URLs - that's a HTTP thing.
Only options are:
- more subdomains (bit of a pain)
- more ports (hard to remember)
- some sort of header in the submitted content - but at that point you're better off using curl
echo "test: 123" | curl -d @- -H 'Content-Type: text/yaml' https://api.pastes.dev/postAuto-detection is also a bit tricky, but I'll elaborate more on that another time, on the other issue.
Subdomains seem somewhat doable? Because you can have wildcard subdomains & SSL records which would make the hosting part fairly simple.
Something like yaml.nc.pastes.dev could work.
from paste.
The server doesn't know which subdomain the request was made from.
This is only possible for HTTP servers because of the Host
header - whereas netcat does the DNS resolution on the client side and then opens a direct TCP connection.
from paste.
The server doesn't know which subdomain the request was made from.
This is only possible for HTTP servers because of the
Host
header - whereas netcat does the DNS resolution on the client side and then opens a direct TCP connection.
Ahhhhh, okay. Makes sense.
from paste.
Related Issues (15)
- Dark mode HOT 1
- Automatic selection of language based on query parameters
- Have a read-only editor window when viewing pastes HOT 10
- Multi-arch docker image support HOT 1
- Log formatting option HOT 2
- Page Not Found error on Netlify
- paste cannot run in docker environment HOT 2
- 502 Bad Gateway on /data/post
- [Feature Request] Support for the TOML config language.
- Disable automatic ligatures display for specific language highlightings
- Keyboard shortcuts HOT 1
- Hocon support
- Better handling for large files
- Automatic language detection for syntax highlighting
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from paste.